Skip to content

Commit

Permalink
workaround for filename decoding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
quiris11 committed May 10, 2014
1 parent 7b597c2 commit 62202a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ExtractCoverThumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ def find_and_copy_cover_file(opfcontent, asin, tempdir, kindlepath, doctype):
for _file in _dir_content:
if _file.endswith('.azw3') or _file.endswith('.azw'):
print('')
print('Processing file ' + _file.decode(sys.getfilesystemencoding()) +
'...')
try:
print('Processing file ' +
_file.decode(sys.getfilesystemencoding()) + '...')
except:
print('Processing file ' +
repr(_file.decode(sys.getfilesystemencoding())) + '...')
try:
_asin_found = re.search('.+_([A-Z0-9]+?)\..+', _file).group(1)
except AttributeError:
Expand Down

0 comments on commit 62202a5

Please sign in to comment.