From 9f9d1ce4047088bb1b972105f51998839dc5e150 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 30 Jul 2011 20:26:21 -0600 Subject: [PATCH] Fix #818704 ("Cannot communicate with device" error on 1st gen Kobo) --- src/calibre/devices/kobo/driver.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 943672effc..528057dad9 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -333,8 +333,14 @@ class KOBO(USBMS): except Exception as e: if 'no such column' not in str(e): raise - cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\', ___PercentRead=0 ' \ - 'where BookID is Null and ContentID =?',t) + try: + cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\', ___PercentRead=0 ' \ + 'where BookID is Null and ContentID =?',t) + except Exception as e: + if 'no such column' not in str(e): + raise + cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\' ' \ + 'where BookID is Null and ContentID =?',t) connection.commit()