tDo not bail on wrong html encoding. - zs - Zeitungsschau rss to email converter
(HTM) git clone git://r-36.net/zs
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit eb1dfe87f3b96659a24e5c1c91b4623260ff24b0
(DIR) parent 86b129e4386789f5331765d7b96098e6c2c7bde7
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 17 May 2018 18:45:17 +0200
Do not bail on wrong html encoding.
Diffstat:
zeitungsschau/feedemail.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/zeitungsschau/feedemail.py b/zeitungsschau/feedemail.py
t@@ -50,7 +50,10 @@ def send(feed, to, smtphost="localhost", smtpport=None, ssl="False",\
h2t.inline_links = 0
h2t.links_each_paragraph = 0
- text = "%s\n" % (h2t.handle(article["text"]))
+ try:
+ text = "%s\n" % (h2t.handle(article["text"]))
+ except:
+ text = article["text"]
del h2t
else: