Relatorio

Bug 34

classification
Title: fod2od fails on PyPy
Type: crash Severity: major
Components: opendocument Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: ced Nosy List: ced, roundup-bot
Priority: high Keywords: patch

Created on 2017-08-13 11:52 by ced, last changed 2017-08-31 22:50 by roundup-bot.

Messages
msg42 Author: [hidden] (ced) Date: 2017-08-13 11:52
The tests fail under PyPY with the traceback:

Traceback (most recent call last):
  File "/relatorio/relatorio/tests/test_odt.py", line 340,
in test_generate_fod
    oot = Template(source)
  File "/relatorio/relatorio/templates/opendocument.py",
line 237, in __init__
    encoding, lookup, allow_exec)
  File
"build/bdist.linux-x86_64/egg/genshi/template/markup.py",
line 67, in __init__
    allow_exec=allow_exec)
  File
"build/bdist.linux-x86_64/egg/genshi/template/base.py", line
419, in __init__
    self._stream = self._parse(source, encoding)
  File "/relatorio/relatorio/templates/opendocument.py",
line 258, in _parse
    zf = get_zip_file(source)
  File "/relatorio/relatorio/templates/opendocument.py",
line 820, in get_zip_file
    return zipfile.ZipFile(fod2od(source))
  File "/usr/local/lib-python/2.7/zipfile.py", line 776, in
__init__
    self._RealGetContents()
  File "/usr/local/lib-python/2.7/zipfile.py", line 819, in
_RealGetContents
    raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
msg43 Author: [hidden] (ced) Date: 2017-08-13 11:56
Here is review43411002 that explicitly close the ZipFile
instead of relying on the gc.
msg44 Author: [hidden] (roundup-bot) Date: 2017-08-31 22:50
New changeset 370030d152b5 by C├ędric Krier in branch 'default':
Close ZipFile before returning the BytesIO
http://hg.tryton.org/relatorio/rev/370030d152b5
History
Date User Action Args
2017-08-31 22:50:32roundup-botsetstatus: open -> closed
nosy: + roundup-bot
messages: + msg44
2017-08-13 11:56:23cedsetstatus: new -> open
keywords: + patch
messages: + msg43
2017-08-13 11:52:50cedcreate