mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-24 07:01:30 +02:00
Removed polyglots unicode_type usage
This commit is contained in:
@@ -14,7 +14,6 @@ from ebook_converter.utils.imghdr import identify
|
||||
from ebook_converter import guess_type, guess_all_extensions, prints, force_unicode
|
||||
from ebook_converter.ebooks.metadata import MetaInformation, check_isbn
|
||||
from ebook_converter.ebooks.chardet import xml_to_unicode
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
from ebook_converter.polyglot.binary import as_base64_unicode
|
||||
|
||||
|
||||
@@ -115,7 +114,7 @@ def get_metadata(stream):
|
||||
|
||||
# fallback for book_title
|
||||
if book_title:
|
||||
book_title = unicode_type(book_title)
|
||||
book_title = str(book_title)
|
||||
else:
|
||||
book_title = force_unicode(os.path.splitext(
|
||||
os.path.basename(getattr(stream, 'name',
|
||||
@@ -252,7 +251,7 @@ def _parse_tags(root, mi, ctx):
|
||||
# -- i18n Translations-- ?
|
||||
tags = ctx.XPath('//fb:%s/fb:genre/text()' % genre_sec)(root)
|
||||
if tags:
|
||||
mi.tags = list(map(unicode_type, tags))
|
||||
mi.tags = list(map(str, tags))
|
||||
break
|
||||
|
||||
|
||||
@@ -304,7 +303,7 @@ def _parse_pubdate(root, mi, ctx):
|
||||
year = ctx.XPath('number(//fb:publish-info/fb:year/text())')(root)
|
||||
if float.is_integer(year):
|
||||
# only year is available, so use 2nd of June
|
||||
mi.pubdate = parse_only_date(unicode_type(int(year)))
|
||||
mi.pubdate = parse_only_date(str(int(year)))
|
||||
|
||||
|
||||
def _parse_language(root, mi, ctx):
|
||||
|
||||
Reference in New Issue
Block a user