From 7076d8c2f5576f096ec89189d93b021bae4ce080 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Apr 2013 08:32:01 +0530 Subject: [PATCH] Fix #1163659 (Wrong filename output in error message when "Guide reference not found") --- src/calibre/ebooks/oeb/reader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index 68db089073..d0474fa7e8 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -333,8 +333,8 @@ class OEBReader(object): guide = self.oeb.guide manifest = self.oeb.manifest for elem in xpath(opf, '/o2:package/o2:guide/o2:reference'): - href = elem.get('href') - path = urlnormalize(urldefrag(href)[0]) + ref_href = elem.get('href') + path = urlnormalize(urldefrag(ref_href)[0]) if path not in manifest.hrefs: corrected_href = None for href in manifest.hrefs: @@ -342,12 +342,12 @@ class OEBReader(object): corrected_href = href break if corrected_href is None: - self.logger.warn(u'Guide reference %r not found' % href) + self.logger.warn(u'Guide reference %r not found' % ref_href) continue - href = corrected_href + ref_href = corrected_href typ = elem.get('type') if typ not in guide: - guide.add(typ, elem.get('title'), href) + guide.add(typ, elem.get('title'), ref_href) def _find_ncx(self, opf): result = xpath(opf, '/o2:package/o2:spine/@toc')