mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
c27a4f141f
commit
3693494ab1
@ -1636,6 +1636,10 @@ class BasicNewsRecipe(Recipe):
|
|||||||
title, url = None, obj
|
title, url = None, obj
|
||||||
else:
|
else:
|
||||||
title, url = obj
|
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://'):
|
if url.startswith('feed://'):
|
||||||
url = 'http'+url[4:]
|
url = 'http'+url[4:]
|
||||||
self.report_progress(0, _('Fetching feed')+' %s...'%(title if title else url))
|
self.report_progress(0, _('Fetching feed')+' %s...'%(title if title else url))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user