diff --git a/fb2mobi.py b/fb2mobi.py index d0211c7..d7e5852 100755 --- a/fb2mobi.py +++ b/fb2mobi.py @@ -92,7 +92,10 @@ def rm_tmp_files(dest, deleteroot=True): os.rmdir(os.path.join(root, name)) if deleteroot: - os.rmdir(dest) + try: + os.rmdir(dest) + except: + pass def process_file(config, infile, outfile=None): @@ -564,6 +567,8 @@ def process(myargs): if myargs.transliterateauthorandtitle is not None: config.transliterate_author_and_title = myargs.transliterateauthorandtitle + config.log.info(' ') + config.log.info('**********************************************') config.log.info('Using configuration "{0}".'.format(config_file)) if myargs.inputdir: diff --git a/modules/fb2html.py b/modules/fb2html.py index e6b2324..f778e7d 100755 --- a/modules/fb2html.py +++ b/modules/fb2html.py @@ -593,11 +593,11 @@ def parse_description(self, elem): self.book_date = etree.tostring(t, method='text', encoding='utf-8').decode('utf-8').strip() def parse_binary(self, elem): - if elem.attrib['id'] and elem.attrib['content-type']: - have_file = False + if 'id' in elem.attrib: self.log.debug('Parsing binary {0}'.format(elem.attrib)) + have_file = False elid = elem.attrib['id'] - decl_type = elem.attrib['content-type'].lower() + decl_type = elem.attrib['content-type'].lower() if 'content-type' in elem.attrib else '---empty---' buff = base64.b64decode(elem.text.encode('ascii')) try: img = Image.open(io.BytesIO(buff)) diff --git a/version.py b/version.py index fd88130..d25c4a8 100755 --- a/version.py +++ b/version.py @@ -4,4 +4,4 @@ WINDOWS = sys.platform == 'win32' -VERSION = u'3.6.59' +VERSION = u'3.6.60'