Merge branch 'xsetra-bugfix/pack_odt_document'
This commit is contained in:
commit
954fe6aa9b
1 changed files with 7 additions and 0 deletions
|
|
@ -177,7 +177,13 @@ class Renderer(object):
|
|||
self.log.debug('packing document')
|
||||
zip_file = io.BytesIO()
|
||||
|
||||
mimetype = files['mimetype']
|
||||
del files['mimetype']
|
||||
|
||||
zipdoc = zipfile.ZipFile(zip_file, 'a')
|
||||
|
||||
zipdoc.writestr('mimetype', mimetype, zipfile.ZIP_STORED)
|
||||
|
||||
for fname, content in files.items():
|
||||
if sys.version_info >= (2, 7):
|
||||
zipdoc.writestr(fname, content, zipfile.ZIP_DEFLATED)
|
||||
|
|
@ -572,6 +578,7 @@ class Renderer(object):
|
|||
if not 'result' in locals():
|
||||
result = xml_source
|
||||
near = result.split('\n')[e.lineno -1][e.offset-200:e.offset+200]
|
||||
|
||||
raise ExpatError('ExpatError "%s" at line %d, column %d\nNear of: "[...]%s[...]"' % \
|
||||
(ErrorString(e.code), e.lineno, e.offset, near))
|
||||
except:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue