mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 18:23:47 +02: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
1 changed files with 3 additions and 1 deletions
|
|
@ -19,7 +19,9 @@ def __init__(self, id, title, url, author, summary, published, content):
|
|||
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…
Reference in a new issue