From e606618d0469bbb5f6204bed73a73e644d2ea7e2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 Oct 2012 08:53:19 +0530 Subject: [PATCH] MTP driver: Ignore errors when getting the driveinfo.calibre file from the device and simply regenerate it --- src/calibre/devices/mtp/driver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/mtp/driver.py b/src/calibre/devices/mtp/driver.py index be2bab7638..1584a3bf93 100644 --- a/src/calibre/devices/mtp/driver.py +++ b/src/calibre/devices/mtp/driver.py @@ -108,10 +108,12 @@ class MTP_DEVICE(BASE): f = storage.find_path((self.DRIVEINFO,)) dinfo = {} if f is not None: - stream = self.get_mtp_file(f) try: + stream = self.get_mtp_file(f) dinfo = json.load(stream, object_hook=from_json) except: + prints('Failed to load existing driveinfo.calibre file, with error:') + traceback.print_exc() dinfo = None if dinfo.get('device_store_uuid', None) is None: dinfo['device_store_uuid'] = unicode(uuid.uuid4())