Lit conversion error (Conversion options changed from default)

Bug #1837561 reported by Albus on 2019-07-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

For the past few updated (Somewhere around 3.41.3 onward) trying to conver epub files to lit results in the following error:

calibre, version 3.46.0 (win32, embedded-python: True)
Conversion error: Failed: Convert book 1 of 1 (Dungeon Robotics)

Convert book 1 of 1 (Dungeon Robotics)
Conversion options changed from defaults:
  output_profile: u'generic_eink'
  read_metadata_from_opf: u'C:\\Users\\albus\\AppData\\Local\\Temp\\calibre_rzblfs\\ckkazh.opf'
  cover: u'C:\\Users\\albus\\AppData\\Local\\Temp\\calibre_rzblfs\\slobzj.jpeg'
  verbose: 2
  page_breaks_before: u"//*[name()='h1' or name()='h2']"
Resolved conversion options
calibre version: 3.46.0
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'C:\\Users\\albus\\AppData\\Local\\Temp\\calibre_rzblfs\\slobzj.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'filter_css': u'',
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x04B0B3D0>,
 'insert_blank_line': False,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.GenericEink object at 0x04B0B5D0>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'C:\\Users\\albus\\AppData\\Local\\Temp\\calibre_rzblfs\\ckkazh.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'search_replace': '[]',
 'series': None,
 'series_index': None,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'start_reading_at': None,
 'subset_embedded_fonts': False,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'transform_css_rules': '[]',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\albus\AppData\Local\Temp\calibre_rzblfs\faguk_.epub
Found HTML cover OEBPS/cover.xhtml
Parsing all content...
Parsing OEBPS/file0052.xhtml ...
Parsing OEBPS/file0087.xhtml ...
Parsing OEBPS/file0022.xhtml ...
Parsing OEBPS/file0064.xhtml ...
Parsing OEBPS/file0024.xhtml ...
Parsing OEBPS/file0068.xhtml ...
Parsing OEBPS/file0072.xhtml ...
Parsing OEBPS/file0076.xhtml ...
Parsing OEBPS/file0103.xhtml ...
Parsing OEBPS/file0113.xhtml ...
Parsing OEBPS/file0053.xhtml ...
Parsing OEBPS/file0060.xhtml ...
Parsing OEBPS/file0031.xhtml ...
Parsing OEBPS/file0077.xhtml ...
Parsing OEBPS/file0039.xhtml ...
Parsing OEBPS/file0017.xhtml ...
Parsing OEBPS/file0043.xhtml ...
Parsing OEBPS/file0081.xhtml ...
Parsing OEBPS/file0047.xhtml ...
Parsing OEBPS/file0083.xhtml ...
Parsing OEBPS/file0041.xhtml ...
Parsing OEBPS/file0085.xhtml ...
Parsing OEBPS/file0079.xhtml ...
Parsing OEBPS/file0054.xhtml ...
Parsing OEBPS/file0089.xhtml ...
Parsing OEBPS/file0063.xhtml ...
Parsing OEBPS/file0091.xhtml ...
Parsing OEBPS/file0019.xhtml ...
Parsing OEBPS/file0067.xhtml ...
Parsing OEBPS/file0093.xhtml ...
Parsing OEBPS/cover.xhtml ...
Parsing OEBPS/file0071.xhtml ...
Parsing OEBPS/file0075.xhtml ...
Parsing OEBPS/file0097.xhtml ...
Parsing OEBPS/file0026.xhtml ...
Parsing OEBPS/file0099.xhtml ...
Parsing OEBPS/stylesheet.css ...
Parsing OEBPS/file0109.xhtml ...
Parsing OEBPS/file0028.xhtml ...
Parsing OEBPS/file0101.xhtml ...
Parsing OEBPS/file0001.xhtml ...
Parsing OEBPS/file0112.xhtml ...
Parsing OEBPS/file0030.xhtml ...
Parsing OEBPS/file0055.xhtml ...
Parsing OEBPS/file0003.xhtml ...
Parsing OEBPS/file0032.xhtml ...
Parsing OEBPS/file0105.xhtml ...
Parsing OEBPS/file0005.xhtml ...
Parsing OEBPS/file0034.xhtml ...
Parsing OEBPS/file0107.xhtml ...
Parsing OEBPS/file0059.xhtml ...
Parsing OEBPS/file0036.xhtml ...
Parsing OEBPS/file0009.xhtml ...
Parsing OEBPS/file0038.xhtml ...
Parsing OEBPS/file0018.xhtml ...
Parsing OEBPS/file0011.xhtml ...
Parsing OEBPS/file0042.xhtml ...
Parsing OEBPS/file0013.xhtml ...
Parsing OEBPS/file0046.xhtml ...
Parsing OEBPS/file0066.xhtml ...
Parsing OEBPS/file0056.xhtml ...
Parsing OEBPS/file0058.xhtml ...
Parsing OEBPS/file0021.xhtml ...
Parsing OEBPS/file0062.xhtml ...
Parsing OEBPS/file0023.xhtml ...
Parsing OEBPS/file0057.xhtml ...
Parsing OEBPS/file0070.xhtml ...
Parsing OEBPS/file0074.xhtml ...
Parsing OEBPS/file0111.xhtml ...
Parsing OEBPS/file0049.xhtml ...
Parsing OEBPS/file0025.xhtml ...
Parsing OEBPS/file0037.xhtml ...
Parsing OEBPS/file0078.xhtml ...
Parsing OEBPS/file0015.xhtml ...
Parsing OEBPS/file0080.xhtml ...
Parsing OEBPS/file0045.xhtml ...
Parsing OEBPS/file0082.xhtml ...
Parsing OEBPS/file0084.xhtml ...
Parsing OEBPS/file0086.xhtml ...
Parsing OEBPS/file0050.xhtml ...
Parsing OEBPS/file0088.xhtml ...
Parsing OEBPS/file0090.xhtml ...
Parsing OEBPS/file0065.xhtml ...
Parsing OEBPS/file0020.xhtml ...
Parsing OEBPS/file0092.xhtml ...
Parsing OEBPS/file0069.xhtml ...
Parsing OEBPS/file0094.xhtml ...
Parsing OEBPS/file0073.xhtml ...
Parsing OEBPS/file0096.xhtml ...
Parsing OEBPS/file0098.xhtml ...
Parsing OEBPS/file0027.xhtml ...
Parsing OEBPS/file0100.xhtml ...
Parsing OEBPS/title_page.xhtml ...
Parsing OEBPS/file0110.xhtml ...
Parsing OEBPS/file0029.xhtml ...
Parsing OEBPS/file0095.xhtml ...
Parsing OEBPS/file0102.xhtml ...
Parsing OEBPS/file0002.xhtml ...
Parsing OEBPS/file0114.xhtml ...
Parsing OEBPS/file0051.xhtml ...
Parsing OEBPS/file0007.xhtml ...
Parsing OEBPS/file0104.xhtml ...
Parsing OEBPS/file0004.xhtml ...
Parsing OEBPS/file0033.xhtml ...
Parsing OEBPS/file0106.xhtml ...
Parsing OEBPS/file0006.xhtml ...
Parsing OEBPS/file0035.xhtml ...
Parsing OEBPS/file0061.xhtml ...
Parsing OEBPS/file0108.xhtml ...
Parsing OEBPS/file0008.xhtml ...
Parsing OEBPS/file0010.xhtml ...
Parsing OEBPS/file0040.xhtml ...
Parsing OEBPS/file0016.xhtml ...
Parsing OEBPS/file0012.xhtml ...
Parsing OEBPS/file0044.xhtml ...
Parsing OEBPS/file0014.xhtml ...
Parsing OEBPS/file0048.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 4 items of level: p_3
Found 6484 items of level: p_2
Found 115 items of level: div_1
Found 1 items of level: div_2
Ignoring level p_3
p_2 left margin stats: Counter({u'0': 6484})
p_2 right margin stats: Counter({u'0': 6484})
div_1 left margin stats: Counter({u'': 114})
div_1 right margin stats: Counter({u'': 114})
div_2 left margin stats: Counter()
div_2 right margin stats: Counter()
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'OEBPS/cover.xhtml' from manifest
Creating LIT Output...
Splitting markup on page breaks and flow limits, if any...
Generating in-line TOC...
Applying case-transforming CSS...
Parsing manglecase.css ...
Parsing tocstyle.css ...
Rasterizing SVG images...
Python function terminated unexpectedly
  'unicode' does not have the buffer interface (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 101, in main
  File "site.py", line 78, in run_entry_point
  File "site-packages\calibre\utils\ipc\worker.py", line 200, in main
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 42, in gui_convert_override
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 27, in gui_convert
  File "site-packages\calibre\ebooks\conversion\plumber.py", line 1274, in run
  File "site-packages\calibre\ebooks\conversion\plugins\lit_output.py", line 38, in convert
  File "site-packages\calibre\ebooks\lit\writer.py", line 330, in __call__
  File "site-packages\calibre\ebooks\lit\writer.py", line 340, in _dump_stream
  File "site-packages\calibre\ebooks\lit\writer.py", line 359, in _write_content
  File "site-packages\calibre\ebooks\lit\writer.py", line 725, in _build_dchunks
TypeError: 'unicode' does not have the buffer interface

The same conversion works fine when I am using an older copy of Calibre (3.40.1).
I have not tried converting to any other format.

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers