MemoryError when converting from EPUB to MOBI

Bug #1772372 reported by Alice Raunsbæk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Unassigned

Bug Description

I get the following details have the stacktrace/traceback at the bottom, it is from trying to convert a 12MB epub (attached) to mobi. The error occurs after about three hours and fifteen minutes.

I will also comment I would not expect the conversion to take so long at all... The first long time it looks like nothing is happening and the progress counter remains at 1%

calibre 3.23

windows 10 (with all available updates applied)

--- Details ---
Convert book 1 of 1 (The Brain Hacker Book)
Conversion options changed from defaults:
  mobi_file_type: u'new'
  read_metadata_from_opf: u'C:\\Users\\Alice\\AppData\\Local\\Temp\\calibre_86zrgf\\qjou8w.opf'
  verbose: 2
  mobi_keep_original_images: True
  cover: u'C:\\Users\\Alice\\AppData\\Local\\Temp\\calibre_86zrgf\\ll4fxn.jpeg'
  output_profile: 'kindle'
Resolved conversion options
calibre version: 3.23.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\\Alice\\AppData\\Local\\Temp\\calibre_86zrgf\\ll4fxn.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_compress': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'extract_to': 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 0x079C9610>,
 '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,
 'mobi_file_type': u'new',
 'mobi_ignore_margins': False,
 'mobi_keep_original_images': True,
 'mobi_toc_at_start': False,
 'no_chapters_in_toc': False,
 'no_inline_navbars': True,
 'no_inline_toc': False,
 'output_profile': <calibre.customize.profiles.KindleOutput object at 0x079C9970>,
 'page_breaks_before': u'/',
 'personal_doc': u'[PDOC]',
 'prefer_author_sort': False,
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'C:\\Users\\Alice\\AppData\\Local\\Temp\\calibre_86zrgf\\qjou8w.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,
 'share_not_sync': False,
 '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': '[]',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\Alice\AppData\Local\Temp\calibre_86zrgf\bkcmfr.epub
Parsing all content...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-102.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-11.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-10.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-5.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-2.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-1.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-9.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-58.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-14.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-15.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-13.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-56.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-57.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-12.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-17.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-16.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-18.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-19.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-20.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-21.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-22.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-23.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-24.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-25.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-26.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-27.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-28.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-29.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-30.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-31.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-32.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-33.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-34.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-35.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-36.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-37.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-38.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-39.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-40.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-41.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-42.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-43.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-44.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-45.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-46.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-47.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-48.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-49.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-50.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-51.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-52.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-53.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-54.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-55.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-7.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-60.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-61.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-62.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-63.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-64.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-65.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-66.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-67.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-68.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-69.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-71.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-72.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-74.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-75.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-77.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-78.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-80.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-81.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-83.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-84.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-86.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-87.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-88.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-89.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-90.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-91.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-92.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-93.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-94.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-95.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-96.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-97.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-98.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-99.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-100.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-101.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-103.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-104.xhtml ...
Parsing OEBPS/toc.xhtml ...
Parsing OEBPS/css/idGeneratedStyles.css ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-4.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-3.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-59.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-8.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-6.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-70.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-73.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-76.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-79.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-82.xhtml ...
Parsing OEBPS/The_Brain_Hacker_Book_eBOOK-85.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 80 items of level: p_4
Found 115 items of level: div_3
Found 4233 items of level: div_2
Found 1264 items of level: div_1
p_4 left margin stats: Counter({u'0': 80})
p_4 right margin stats: Counter({u'0': 80})
div_3 left margin stats: Counter({u'0': 115})
div_3 right margin stats: Counter({u'0': 115})
div_2 left margin stats: Counter({u'0': 3})
div_2 right margin stats: Counter({u'0': 3})
div_1 left margin stats: Counter({u'0': 252})
div_1 right margin stats: Counter({u'0': 252})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'OEBPS/toc.xhtml' from manifest
Creating MOBI Output...
Serializing resources...
Splitting markup on page breaks and flow limits, if any...
Creating KF8 output
 Generating KF8 markup...
Python function terminated unexpectedly
   (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 195, in main
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 33, in gui_convert_override
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 26, in gui_convert
  File "site-packages\calibre\ebooks\conversion\plumber.py", line 1252, in run
  File "site-packages\calibre\ebooks\conversion\plugins\mobi_output.py", line 205, in convert
  File "site-packages\calibre\ebooks\conversion\plugins\mobi_output.py", line 217, in create_kf8
  File "site-packages\calibre\ebooks\mobi\writer8\main.py", line 497, in create_kf8_book
  File "site-packages\calibre\ebooks\mobi\writer8\main.py", line 58, in __init__
  File "site-packages\calibre\ebooks\mobi\writer8\main.py", line 91, in dup_data
  File "site-packages\cssutils\__init__.py", line 179, in parseString
  File "site-packages\cssutils\parse.py", line 148, in parseString
  File "site-packages\cssutils\css\cssstylesheet.py", line 355, in _setCssTextWithEncodingOverride
  File "site-packages\cssutils\css\cssstylesheet.py", line 303, in _setCssText
  File "site-packages\cssutils\util.py", line 461, in _parse
  File "site-packages\cssutils\tokenize2.py", line 146, in tokenize
MemoryError

Revision history for this message
Alice Raunsbæk (aliceraunsbaek) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1772372

That is an out of memory error. If you have a computer with lots of RAM
and a 64bit version of windows, install the 64 bit version of calibre,
that may let you convert this document. Otherwise you are out of luck.

 status wontfix

Changed in calibre:
status: New → Won't Fix
Revision history for this message
Alice Raunsbæk (aliceraunsbaek) wrote :

Thank you, that helped!

I was looking for the 64bit link on the download page when I downloaded the program (I had gone directly to the download page from a search), but did not find one. I would recommend that the 32bit windows download page be amended with a link to the 64bit download page (and perhaps visa versa) to help people find the correct page, even if going straight to a download page from a search engine (and that engine landing them on the other page).

After all, I just did a google search for calibre windows download, I suspect other users might too...

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.