mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2311 (Failure to parse an lrf file)
This commit is contained in:
parent
8e68f9d4dd
commit
021149097f
@ -970,7 +970,12 @@ class Canvas(LRFStream):
|
||||
stream = cStringIO.StringIO(self.stream)
|
||||
while stream.tell() < len(self.stream):
|
||||
tag = Tag(stream)
|
||||
self._contents.append(PutObj(self._document.objects, *struct.unpack("<HHI", tag.contents)))
|
||||
try:
|
||||
self._contents.append(
|
||||
PutObj(self._document.objects,
|
||||
*struct.unpack("<HHI", tag.contents)))
|
||||
except struct.error:
|
||||
print 'Canvas object has errors, skipping.'
|
||||
|
||||
def __unicode__(self):
|
||||
s = '\n<%s objid="%s" '%(self.__class__.__name__, self.id,)
|
||||
|
Loading…
x
Reference in New Issue
Block a user