Fix #1897596 [News fetch breaks on TypeError in 5.0.1/Python 3 for legacy feeds created in prior Python 2-based versions](https://bugs.launchpad.net/calibre/+bug/1897596)

This commit is contained in:
Kovid Goyal 2020-09-28 21:40:51 +05:30
parent c27a4f141f
commit 3693494ab1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1636,6 +1636,10 @@ class BasicNewsRecipe(Recipe):
title, url = None, obj
else:
title, url = obj
if isinstance(title, bytes):
title = title.decode('utf-8')
if isinstance(url, bytes):
url = url.decode('utf-8')
if url.startswith('feed://'):
url = 'http'+url[4:]
self.report_progress(0, _('Fetching feed')+' %s...'%(title if title else url))