From b9a8a648d9fd72541237d3ffba94f7f91ef876fc Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 3 Jun 2019 14:27:45 -0500 Subject: [PATCH] Fix for extended chars in text email imap fetchs on py3. --- fanficfare/geturls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fanficfare/geturls.py b/fanficfare/geturls.py index 583a1ae2..4cecbd6f 100644 --- a/fanficfare/geturls.py +++ b/fanficfare/geturls.py @@ -128,9 +128,10 @@ def get_urls_from_html(data,url=None,configuration=None,normalize=False,restrict def get_urls_from_text(data,configuration=None,normalize=False,email=False): urls = collections.OrderedDict() try: - data = ensure_str(data) + # py3 can have issues with extended chars in txt emails + data = ensure_str(data,errors='replace') except UnicodeDecodeError: - data=data.decode('utf8') ## for when called outside calibre. + data = data.decode('utf8') ## for when called outside calibre. if not configuration: configuration = Configuration(["test1.com"],"EPUB",lightweight=True)