apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.52k stars 1.51k forks source link

Error while converting book - TypeError: encoded string too long (721, maximum length 519) #981

Closed klever-zz closed 4 years ago

klever-zz commented 4 years ago

calibre Debug log calibre 4.5 [64bit] embedded-python: True is64bit: True Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.18362') Python 2.7.16+ Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 27, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 27, 0) && KFX metadata reader (from KFX Input) (1, 27, 0) && KFX Input (1, 27, 0) calibre 4.5 [64bit] embedded-python: True is64bit: True Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.18362') Python 2.7.16+ Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 27, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 27, 0) && KFX metadata reader (from KFX Input) (1, 27, 0) && KFX Input (1, 27, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 120.0 x 120.0 physicalDpi: 127.664921466 x 127.590697674 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.64] splash screen shown [0.64] Initializing db... [0.64] db initialized [0.64] Constructing main UI... [2.00] main UI initialized... [2.00] Hiding splash screen [9.39] splash screen hidden [9.39] Started up in 9.39 seconds with 1 books stdout+stderr from file dialog helper: ['', ''] piped data from file dialog helper: ['\x1a`4\x89\xee\xf0\x82\xed\x91t\x01\x82\xce;R\xe5\xaba\xd6\xefD\xdc\xa2\xe6RUS\x11\rm2\xd4', 'C:\Users\Serge Klever\Documents\My Kindle Content\B07MT7DW5T_EBOK\CR!CCZTSE0K09415257VAH6HN4PJ6H6.azw.md'] Added CR!CCZTSE0K09415257VAH6HN4PJ6H6.azw to db in: 0.1 Added 1 books in 0.5 seconds Worker Launch took: 0.161999940872 Job: 0 Convert book 1 of 1 (CR!CCZTSE0K09415257VAH6HN4PJ6H6.azw) finished Convert book 1 of 1 (CR!CCZTSE0K09415257VAH6HN4PJ6H6.azw) Conversion options changed from defaults: output_profile: u'generic_eink' read_metadata_from_opf: u'C:\Users\SERGEK~1\AppData\Local\Temp\calibreuqwnu4\zh4gd.opf' markdown_extensions: u'tables, footnotes, toc' verbose: 2 Resolved conversion options calibre version: 4.5.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': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_split_on_page_breaks': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'epub_flatten': False, 'epub_inline_toc': False, 'epub_toc_at_end': False, 'epub_version': u'2', 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'flow_size': 260, 'font_size_mapping': None, 'format_scene_breaks': True, 'formatting_type': u'auto', 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000014F01D10A08>, '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, 'markdown_extensions': u'tables, footnotes, toc', 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_default_epub_cover': False, 'no_inline_navbars': False, 'no_svg_cover': False, 'output_profile': <calibre.customize.profiles.GenericEink object at 0x0000014F01D14648>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'paragraph_type': u'auto', 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'preserve_spaces': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\SERGEK~1\AppData\Local\Temp\calibreuqwnu4\zh4gd.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, 'toc_title': None, 'transform_css_rules': '[]', 'txt_in_remove_indents': False, 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: TXT Input running on C:\Users\SERGEK~1\AppData\Local\Temp\calibre_uqwnu4_hpadf.md Reading text from file... File extension indicates particular formatting. Forcing formatting type to: markdown Detected input encoding as Windows-1254 with a confidence of 36.7670525586% Running text through markdown conversion... Language not specified Creator not specified Building file list... Python function terminated unexpectedly encoded string too long (721, maximum length 519) (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 208, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 43, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1110, in run File "site-packages\calibre\customize\conversion.py", line 246, in call File "site-packages\calibre\ebooks\conversion\plugins\txt_input.py", line 287, in convert File "site-packages\calibre\ebooks\conversion\plugins\html_input.py", line 84, in convert File "site-packages\calibre\ebooks\conversion\plugins\html_input.py", line 145, in create_oebbook File "site-packages\calibre\ebooks\html\input.py", line 253, in get_filelist File "site-packages\calibre\ebooks\html\input.py", line 213, in traverse File "site-packages\calibre\ebooks\html\input.py", line 145, in init File "site-packages\calibre\ebooks\html\input.py", line 168, in find_links File "site-packages\calibre\ebooks\html\input.py", line 176, in resolve File "site-packages\calibre\ebooks\html\input.py", line 57, in init File "site-packages\calibre\ebooks\html\input.py", line 41, in url_to_local_path File "ntpath.py", line 488, in abspath TypeError: encoded string too long (721, maximum length 519)

Convert book 1 of 1 (CR!CCZTSE0K09415257VAH6HN4PJ6H6.azw) Conversion options changed from defaults: output_profile: u'generic_eink' read_metadata_from_opf: u'C:\Users\SERGEK~1\AppData\Local\Temp\calibreuqwnu4\zh4gd.opf' markdown_extensions: u'tables, footnotes, toc' verbose: 2 Resolved conversion options calibre version: 4.5.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': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_split_on_page_breaks': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'epub_flatten': False, 'epub_inline_toc': False, 'epub_toc_at_end': False, 'epub_version': u'2', 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'flow_size': 260, 'font_size_mapping': None, 'format_scene_breaks': True, 'formatting_type': u'auto', 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000014F01D10A08>, '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, 'markdown_extensions': u'tables, footnotes, toc', 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_default_epub_cover': False, 'no_inline_navbars': False, 'no_svg_cover': False, 'output_profile': <calibre.customize.profiles.GenericEink object at 0x0000014F01D14648>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'paragraph_type': u'auto', 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'preserve_spaces': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\SERGEK~1\AppData\Local\Temp\calibreuqwnu4\zh4gd.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, 'toc_title': None, 'transform_css_rules': '[]', 'txt_in_remove_indents': False, 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: TXT Input running on C:\Users\SERGEK~1\AppData\Local\Temp\calibre_uqwnu4_hpadf.md Reading text from file... File extension indicates particular formatting. Forcing formatting type to: markdown Detected input encoding as Windows-1254 with a confidence of 36.7670525586% Running text through markdown conversion... Language not specified Creator not specified Building file list... Python function terminated unexpectedly encoded string too long (721, maximum length 519) (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 208, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 43, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1110, in run File "site-packages\calibre\customize\conversion.py", line 246, in call File "site-packages\calibre\ebooks\conversion\plugins\txt_input.py", line 287, in convert File "site-packages\calibre\ebooks\conversion\plugins\html_input.py", line 84, in convert File "site-packages\calibre\ebooks\conversion\plugins\html_input.py", line 145, in create_oebbook File "site-packages\calibre\ebooks\html\input.py", line 253, in get_filelist File "site-packages\calibre\ebooks\html\input.py", line 213, in traverse File "site-packages\calibre\ebooks\html\input.py", line 145, in init File "site-packages\calibre\ebooks\html\input.py", line 168, in find_links File "site-packages\calibre\ebooks\html\input.py", line 176, in resolve File "site-packages\calibre\ebooks\html\input.py", line 57, in init File "site-packages\calibre\ebooks\html\input.py", line 41, in url_to_local_path File "ntpath.py", line 488, in abspath TypeError: encoded string too long (721, maximum length 519)

tmpejt_06.txt

j-howell commented 4 years ago

Calibre is treating your book as being in markdown format, which happens if you import a file that ends with a ".md" extension. You need to import the main book file, the one with a ".azw" extension instead.

If anything goes wrong you need to post a log of the import process, not conversion, since DRM removal happens when a file is imported. See the FAQ for details.

Also, since you are importing a book from Kindle for PC, you need to be using an older version of that software for DRM removal to work properly. See this for details: https://www.mobileread.com/forums/showthread.php?t=283371

klever-zz commented 4 years ago

Thank you very much. It was a file with a ".md" extension. I forgot about this Windows habit of hiding extensions.