Decoding fails when opening a file with a specific file name in the viewer

Bug #1860889 reported by yoshiki hayashibara on 2020-01-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

(error contents)
If the file name contains "ソ", decoding fails and the file cannot be opened.

Note:"ソ" is Japanese character.

(procedure)
1.Put the file "ソ.cbz" attached to the bug report in any folder.
2.Register "ソ.cbz" in caliber library or open with caliber viewer.

(system info)
OS:Microsoft Windows 10 Pro 64bit
calibre Version:4.9.1

(Error report)
===========================================================================================================
Failed to open the book at C:\ソ.cbz. Click "Show details" for more info.
===========================================================================================================
calibre, version 4.9.1
エラー: Loading book failed: Failed to open the book at C:\book\ソ.cbz. Click "Show details" for more info.

Traceback (most recent call last):
  File "site-packages\calibre\gui2\viewer\ui.py", line 395, in _load_ebook_worker
  File "site-packages\calibre\gui2\viewer\convert_book.py", line 234, in prepare_book
  File "site-packages\calibre\gui2\viewer\convert_book.py", line 191, in do_convert
ConversionFailure: Failed to convert book: C:\book\ソ.cbz with error:
Traceback (most recent call last):
  File "site-packages\calibre\customize\ui.py", line 428, in get_file_type_metadata
  File "site-packages\calibre\customize\builtins.py", line 156, in get_metadata
  File "site-packages\calibre\libunzip.py", line 76, in extract_cover_image
  File "site-packages\calibre\utils\zipfile.py", line 766, in __init__
  File "site-packages\calibre\utils\zipfile.py", line 801, in _GetContents
  File "site-packages\calibre\utils\zipfile.py", line 847, in _RealGetContents
  File "site-packages\calibre\utils\zipfile.py", line 331, in __init__
UnicodeDecodeError: 'utf8' codec can't decode byte 0x83 in position 0: invalid start byte
InputFormatPlugin: Comic Input running
on C:\book\ソ.cbz
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Python function terminated unexpectedly
  'utf8' codec can't decode byte 0x83 in position 0: invalid start byte (Error Code: 1)
 Traceback (most recent call last):
  File "site.py", line 114, in main
  File "site.py", line 88, in run_entry_point
  File "site-packages\calibre\utils\ipc\worker.py", line 189, in main
  File "<string>", line 1, in <module>
  File "site-packages\calibre\srv\render_book.py", line 851, in viewer_main
  File "site-packages\calibre\srv\render_book.py", line 844, in render_for_viewer
  File "site-packages\calibre\srv\render_book.py", line 819, in render
  File "site-packages\calibre\ebooks\oeb\iterator\book.py", line 64, in extract_book
  File "site-packages\calibre\customize\conversion.py", line 246, in __call__
  File "site-packages\calibre\ebooks\conversion\plugins\comic_input.py", line 185, in convert
  File "site-packages\calibre\ebooks\conversion\plugins\comic_input.py", line 134, in get_pages
  File "site-packages\calibre\ebooks\comic\input.py", line 36, in extract_comic
  File "site-packages\calibre\__init__.py", line 274, in extract
  File "site-packages\calibre\libunzip.py", line 47, in extract
  File "site-packages\calibre\utils\zipfile.py", line 766, in __init__
  File "site-packages\calibre\utils\zipfile.py", line 801, in _GetContents
  File "site-packages\calibre\utils\zipfile.py", line 847, in _RealGetContents
  File "site-packages\calibre\utils\zipfile.py", line 331, in __init__
UnicodeDecodeError: 'utf8' codec can't decode byte 0x83 in position 0: invalid start byte
===========================================================================================================

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released

Confirmed that the issue has been fixed.
Thank you.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments