mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
...
This commit is contained in:
parent
ebda738c81
commit
19d7f6d39f
2 changed files with 3 additions and 3 deletions
|
|
@ -21,7 +21,7 @@
|
|||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre.customize.conversion import OptionRecommendation
|
||||
from calibre.constants import islinux, isfreebsd, iswindows
|
||||
from calibre import unicode_path
|
||||
from calibre import unicode_path, as_unicode
|
||||
from calibre.utils.localization import get_lang
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
from calibre.ebooks.conversion.utils import PreProcessor
|
||||
|
|
@ -112,7 +112,7 @@ def __init__(self, path_to_html_file, level, encoding, verbose, referrer=None):
|
|||
with open(self.path, 'rb') as f:
|
||||
src = f.read()
|
||||
except IOError, err:
|
||||
msg = 'Could not read from file: %s with error: %s'%(self.path, unicode(err))
|
||||
msg = 'Could not read from file: %s with error: %s'%(self.path, as_unicode(err))
|
||||
if level == 0:
|
||||
raise IOError(msg)
|
||||
raise IgnoreFile(msg, err.errno)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ def is_date_undefined(qt_or_dt):
|
|||
return True
|
||||
if hasattr(d, 'toString'):
|
||||
d = datetime(d.year(), d.month(), d.day(), tzinfo=utc_tz)
|
||||
return d.year == UNDEFINED_DATE.year and \
|
||||
return d.year <= UNDEFINED_DATE.year and \
|
||||
d.month == UNDEFINED_DATE.month and \
|
||||
d.day == UNDEFINED_DATE.day
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue