Calibre_parallel crashes during pdf to epub export

Bug #1030544 reported by davide cerrato
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
calibre (Ubuntu)
Confirmed
Undecided
Unassigned
cssutils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu 12.04
Calibre fails to convert to epub.
This is happening for all files
Below an error output as example

Calibre, version 0.8.38
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (Un Altro Giro Di Giostra)

Convert book 1 of 1 (Un Altro Giro Di Giostra)
Resolved conversion options
calibre version: 0.8.38
{'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': '/tmp/calibre_0.8.38_tmp_bAjnyt/w6E1Y_.jpeg',
 'debug_pipeline': None,alibre, version 0.8.38
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (Un Altro Giro Di Giostra)

Convert book 1 of 1 (Un Altro Giro Di Giostra)
Resolved conversion options
calibre version: 0.8.38
{'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': '/tmp/calibre_0.8.38_tmp_bAjnyt/w6E1Y_.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_split_on_page_breaks': False,
 'duplicate_links_in_toc': False,
 'enable_heuristics': False,
 'epub_flatten': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': u'',
 'fix_indents': True,
 'flow_size': 260,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x9da768c>,
 '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,
 'new_pdf_engine': False,
 'no_chapters_in_toc': False,
 'no_default_epub_cover': False,
 'no_images': False,
 'no_inline_navbars': False,
 'no_svg_cover': False,
 'output_profile': <calibre.customize.profiles.OutputProfile object at 0xa48892c>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio': False,
 'pretty_print': True,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': '/tmp/calibre_0.8.38_tmp_bAjnyt/p6KZ_t.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'',
 '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,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'unsmarten_punctuation': False,
 'unwrap_factor': 0.45,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
Traceback (most recent call last):
  File "/usr/bin/calibre-parallel", line 19, in <module>
    sys.exit(main())
  File "/usr/lib/calibre/calibre/utils/ipc/worker.py", line 191, in main
    result = func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override
    override_input_metadata=True)
  File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
    plumber.run()
  File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 920, in run
    import cssutils, logging
  File "/usr/lib/python2.7/dist-packages/cssutils/__init__.py", line 109, in <module>
    from . import util
  File "/usr/lib/python2.7/dist-packages/cssutils/util.py", line 20, in <module>
    from _fetch import _defaultFetcher
  File "/usr/lib/python2.7/dist-packages/cssutils/_fetch.py", line 8, in <module>
    import encutils
ImportError: No module named encutils

 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_split_on_page_breaks': False,
 'duplicate_links_in_toc': False,
 'enable_heuristics': False,
 'epub_flatten': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': u'',
 'fix_indents': True,
 'flow_size': 260,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x9da768c>,
 '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,
 'new_pdf_engine': False,
 'no_chapters_in_toc': False,
 'no_default_epub_cover': False,
 'no_images': False,
 'no_inline_navbars': False,
 'no_svg_cover': False,
 'output_profile': <calibre.customize.profiles.OutputProfile object at 0xa48892c>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio': False,
 'pretty_print': True,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': '/tmp/calibre_0.8.38_tmp_bAjnyt/p6KZ_t.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'',
 '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,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'unsmarten_punctuation': False,
 'unwrap_factor': 0.45,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
Traceback (most recent call last):
  File "/usr/bin/calibre-parallel", line 19, in <module>
    sys.exit(main())
  File "/usr/lib/calibre/calibre/utils/ipc/worker.py", line 191, in main
    result = func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override
    override_input_metadata=True)
  File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
    plumber.run()
  File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 920, in run
    import cssutils, logging
  File "/usr/lib/python2.7/dist-packages/cssutils/__init__.py", line 109, in <module>
    from . import util
  File "/usr/lib/python2.7/dist-packages/cssutils/util.py", line 20, in <module>
    from _fetch import _defaultFetcher
  File "/usr/lib/python2.7/dist-packages/cssutils/_fetch.py", line 8, in <module>
    import encutils
ImportError: No module named encutils

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in calibre (Ubuntu):
status: New → Confirmed
Revision history for this message
Graham Inggs (ginggs) wrote :

cssutils/_fetch.py tries to import encutils which is no longer in a seperate package

affects: calibre (Ubuntu) → cssutils (Ubuntu)
Revision history for this message
Graham Inggs (ginggs) wrote :

In Precise, removing the line:

import encutils

from /usr/lib/python2.7/dist-packages/cssutils/_fetch.py , fixes the problem in Calibre.

There is a try/except block in cssutils/script.py that imports encutils as well, but it doesn't get called by Calibre.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Graham: Why would we remove an import that's used?

The encutils module is included in python-cssutils. Why is it failing to import? That's the real question here

Graham Inggs (ginggs)
Changed in calibre (Ubuntu):
status: New → Confirmed
Revision history for this message
Graham Inggs (ginggs) wrote :

After shutting down and later powering up the machine that experienced the problem, I have been unable to reproduce it.
It was reproducible before shutting down though, and came and went as I removed and re-inserted the line mentioned above.

I think I need to find why a URL needed to be fetched at all, rather than trying to block it in cssutils.
Perhaps there are still some upgrade checks that need to be removed from Calibre.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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