From 49cb868bb3b0b0659986e1c3ad442c0c89ccc4af Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 31 Jul 2012 15:25:46 +0200 Subject: [PATCH] Use a str type instead of unicode when searching for the opening '[' in the network packet. Using unicode seems to work, but it really is a byte. --- src/calibre/devices/smart_device_app/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py index daab9bcb48..bae5d82ba3 100644 --- a/src/calibre/devices/smart_device_app/driver.py +++ b/src/calibre/devices/smart_device_app/driver.py @@ -291,7 +291,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): def _read_string_from_net(self): data = bytes(0) while True: - dex = data.find('[') + dex = data.find(b'[') if dex >= 0: break # recv seems to return a pointer into some internal buffer.