mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont fail if a non-string object is passed as the title of an article
This commit is contained in:
parent
a31c5b90ae
commit
718e3c9237
@ -19,7 +19,9 @@ class Article(object):
|
||||
from lxml import html
|
||||
self.downloaded = False
|
||||
self.id = id
|
||||
title = force_unicode(title or _('Unknown'), 'utf-8')
|
||||
if not title or not isinstance(title, basestring):
|
||||
title = _('Unknown')
|
||||
title = force_unicode(title, 'utf-8')
|
||||
self._title = clean_xml_chars(title).strip()
|
||||
try:
|
||||
self._title = re.sub(r'&(\S+?);',
|
||||
|
Loading…
x
Reference in New Issue
Block a user