Viewing or converting LRF fails with TypeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In Calibre 5.34, Windows 64-bit, attempting to convert a 2007-era LRF file to MOBI fails with a TypeError and the following stack trace. I get a similar error (same error, same line of code in objects.py) if I attempt to view the LRF directly. The problematic LRF is attached (and the same error happens with dozens of other similar-vintage LRFs)
Convert book 1 of 1 (Gulliver's Travels)
Conversion options changed from defaults:
read_
verbose: 2
Resolved conversion options
calibre version: 5.34.0
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
"'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_
'disable_
'dont_compress': False,
'duplicate_
'embed_all_fonts': False,
'embed_
'enable_
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': '',
'fix_indents': True,
'font_
'format_
'html_
'input_encoding': None,
'input_profile': <calibre.
'insert_
'insert_
'insert_metadata': False,
'isbn': None,
'italicize_
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_
'max_toc_links': 50,
'minimum_
'mobi_file_type': 'old',
'mobi_
'mobi_
'mobi_
'no_chapters_
'no_inline_
'no_inline_toc': False,
'output_profile': <calibre.
'page_
'personal_doc': '[PDOC]',
'prefer_
'prefer_
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_
'remove_
'remove_
'remove_
'remove_
'renumber_
'replace_
'search_replace': '[]',
'series': None,
'series_index': None,
'share_not_sync': False,
'smarten_
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_
'subset_
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_
'transform_
'unsmarten_
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: LRF Input running
on C:\Users\
Generating XML
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "site.py", line 82, in <module>
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
TypeError: a bytes-like object is required, not 'str'
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased