summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2024-01-24 16:11:26 +0100
committeremkael <emkael@tlen.pl>2024-01-24 16:11:26 +0100
commite48a3ac7e52706baaa65297f7ec0bd2a176584ba (patch)
tree2653e5a4ec3ccf7db0393cf89d0f708f8ee71b1b
parent9261c9eaa7340326603342da74cf3a5f32354067 (diff)
If chardet for event name (in HTML/PDF formats) does not detect charset, assume ascii (chances are event name is simply empty)HEADmaster
-rw-r--r--dealconvert/formats/html.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/dealconvert/formats/html.py b/dealconvert/formats/html.py
index efb16ff..6e5537e 100644
--- a/dealconvert/formats/html.py
+++ b/dealconvert/formats/html.py
@@ -184,7 +184,7 @@ class HTMLFormat(BinaryFormat):
def get_html_content(self, dealset):
deal_rows = []
event_name = dealset[0].event
- event_name = event_name.decode(chardet.detect(event_name)['encoding'])
+ event_name = event_name.decode(chardet.detect(event_name)['encoding'] or 'ascii')
while len(dealset) > 0:
deal_rows.append(dealset[0:self.deals_per_column])
dealset = dealset[self.deals_per_column:]