Error in content.opf causes ebook editor checking to fail

Bug #1319378 reported by SteveB on 2014-05-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

Thanks for your responses to other things much appreciated
I thought I'd report this in case it's helpful

If I make a mistake in content.opf manifest, run checks in ebook editor falls over
For example (notice the item paths where I got confused)

<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" unique-identifier="67afb23f-0b1a-4a1d-aaa7-40cf4f5285a6" version="2.0">
    <metadata>
    <dc:identifier id="67afb23f-0b1a-4a1d-aaa7-40cf4f5285a6" opf:scheme="uuid">67afb23f-0b1a-4a1d-aaa7-40cf4f5285a6</dc:identifier>
  </metadata>
    <manifest>
    <item href="Text/test.xhtml" id="id7" media-type="application/xhtml+xml"/>
    <item href="/fonts/Times-New-Roman.ttf" id="font1" media-type="application/x-font-truetype"/>
    <item href="/Styles/fonts.css" id="font_embed1" media-type="text/css"/>
    <item href="/Styles/styles.css" id="id13" media-type="text/css"/>
  </manifest>
  <spine>
    <itemref idref="id7"/>
  </spine>
  <guide>
  </guide>
</package>

Here is output
calibre, version 1.36.0
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'split'

calibre 1.36 isfrozen: True is64bit: False
Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.5
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
  File "site-packages\calibre\gui2\tweak_book\boss.py", line 69, in ans
  File "site-packages\calibre\gui2\tweak_book\boss.py", line 954, in check_requested
  File "site-packages\calibre\gui2\tweak_book\check.py", line 198, in run_checks
  File "site-packages\calibre\ebooks\oeb\polish\check\main.py", line 65, in run_checks
  File "site-packages\calibre\ebooks\oeb\polish\check\opf.py", line 218, in check_opf
  File "site-packages\calibre\ebooks\oeb\polish\container.py", line 320, in exists
  File "site-packages\calibre\ebooks\oeb\polish\container.py", line 317, in name_to_abspath
AttributeError: 'NoneType' object has no attribute 'split'

Fixed in branch master. The fix will be in the next release. calibre is usually released every 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