1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-10 07:03:35 +02:00

Removed isbytestring function

This commit is contained in:
2020-06-14 12:10:40 +02:00
parent a69884d724
commit be671ef2d8
10 changed files with 29 additions and 40 deletions

View File

@@ -3,7 +3,6 @@ import os, re, collections
from ebook_converter.utils.config import prefs
from ebook_converter.constants_old import filesystem_encoding
from ebook_converter.ebooks.metadata.opf2 import OPF
from ebook_converter import isbytestring
from ebook_converter.customize.ui import get_file_type_metadata, set_file_type_metadata
from ebook_converter.ebooks.metadata import MetaInformation, string_to_authors
@@ -126,7 +125,7 @@ def set_metadata(stream, mi, stream_type='lrf', report_error=None):
def metadata_from_filename(name, pat=None, fallback_pat=None):
if isbytestring(name):
if isinstance(name, bytes):
name = name.decode(filesystem_encoding, 'replace')
name = name.rpartition('.')[0]
mi = MetaInformation(None, None)