szarroug3 / X-Ray_Calibre_Plugin

X-Ray Creator plugin for Calibre
http://www.mobileread.com/forums/showthread.php?t=273189
GNU General Public License v3.0
57 stars 12 forks source link

Exception when kindle is plugged in but ejected #56

Closed stoduk closed 8 years ago

stoduk commented 8 years ago

With a kindle attached but ejected, performing a create operation hits the exception below.

I hit this whether I eject in Calibre or in OS X (in the latter case Calibre doesn't seem to handle the ejection until the cable is actually pulled - eg. the "on device" column remains visible).

This is potentially a bug in Calibre, but given we are using code that might not have been intended to be used in this way it is hard to say..

DEBUG: 8696.3 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
DEBUG: 8696.3 USBMS: dirs are: None documents
Job: 6 Creating X-Ray Files finished
Starting job: Creating X-Ray Files 

    06-27-2016 15:33:11 Initializing... 
    Job: "Creating X-Ray Files" failed with error: 
    Traceback (most recent call last):
      File "site-packages/calibre/gui2/threaded_jobs.py", line 83, in start_work
      File "calibre_plugins.xray_creator.lib.xray_creator", line 166, in create_xrays_event
      File "calibre_plugins.xray_creator.lib.xray_creator", line 65, in _initialize_books
      File "calibre_plugins.xray_creator.lib.xray_creator", line 157, in _find_device_books
      File "site-packages/calibre/devices/kindle/driver.py", line 419, in books
      File "site-packages/calibre/devices/usbms/driver.py", line 211, in books
      File "site-packages/calibre/devices/usbms/driver.py", line 485, in parse_metadata_cache
      File "lib/python2.7/posixpath.py", line 70, in join
    AttributeError: 'NoneType' object has no attribute 'endswith'

    Called with args: () {u'abort': <threading._Event object at 0x1235ae710>, u'log': <calibre.utils.logging.GUILog object at 0x1235ae750>, u'notifications': <Queue.Queue instance at 0x1235c5e18>}