From 88ec44caec618750dc75fa8a25051f38549c0811 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 29 Apr 2011 22:30:53 -0600 Subject: [PATCH] ... --- src/calibre/devices/apple/driver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index b11a3f298c..1eefe0001d 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -2626,7 +2626,10 @@ class ITUNES(DriverBase): None, level=UserFeedback.WARN) fnames = zf_opf.namelist() - opf = [x for x in fnames if '.opf' in x][0] + try: + opf = [x for x in fnames if '.opf' in x][0] + except: + opf = None if opf: opf_tree = etree.fromstring(zf_opf.read(opf)) md_els = opf_tree.xpath('.//*[local-name()="metadata"]')