KeyError after deleting unreferenced file

Bug #1632897 reported by Matthew Kidd on 2016-10-13
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I can reliably generate a KeyError in the following scenario.

Run check in the book editor returns two related errors of this form:
The file foo is not referenced
The file foo is not listed in the manifest

At this point if I remove the foo file by right clicking on it in the Files Browser and deleting it, clicking on the second error will generate the KeyError. See attached screenshot. Though the exception is unhandled, it doesn't bring down the e-book editor, so it seems like a benign bug, mostly just confusing to users who don't think like programmers.

I cannot reproduce this with the steps you described. Click the Show
details button on the error message and post the full traceback.

 status incomplete

Changed in calibre:
status: New → Incomplete
Matthew Kidd (mkidd) wrote :

Okay, here is a related scenario. Run check reports that file foo.jpg is not referenced. Double click (not single click) on said error message such that foo.jpg image is shown in the tabbed document editing pane, delete foo.jpg via Files Browser (i.e. right click on filename and delete). Double click (not single click) again on said error message. Exception will occur.

calibre, version 2.69.0
ERROR: Unhandled exception: <b>KeyError</b>:u'OEBPS/godi_9781101196311_msr_cvt_r1.jpg'

calibre 2.69 [64bit] embedded-python: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.9
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
  File "site-packages\calibre\gui2\tweak_book\", line 67, in ans
  File "site-packages\calibre\gui2\tweak_book\", line 1175, in check_item_activated
KeyError: u'OEBPS/godi_9781101196311_msr_cvt_r1.jpg'

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers