mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fixed #5035 (unicode string for cover causes calibredb --output-format stanza to fail)
This commit is contained in:
parent
0667538213
commit
e68833a164
@ -196,6 +196,8 @@ def do_list(db, fields, sort_by, ascending, search_text, line_width, separator,
|
|||||||
for x in data:
|
for x in data:
|
||||||
if isinstance(x['fmt_epub'], unicode):
|
if isinstance(x['fmt_epub'], unicode):
|
||||||
x['fmt_epub'] = x['fmt_epub'].encode('utf-8')
|
x['fmt_epub'] = x['fmt_epub'].encode('utf-8')
|
||||||
|
if isinstance(x['cover'], unicode):
|
||||||
|
x['cover'] = x['cover'].encode('utf-8')
|
||||||
template = MarkupTemplate(STANZA_TEMPLATE)
|
template = MarkupTemplate(STANZA_TEMPLATE)
|
||||||
return template.generate(id="urn:calibre:main", data=data, subtitle=subtitle,
|
return template.generate(id="urn:calibre:main", data=data, subtitle=subtitle,
|
||||||
sep=os.sep, quote=quote, updated=db.last_modified()).render('xml')
|
sep=os.sep, quote=quote, updated=db.last_modified()).render('xml')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user