tiny_sxw2rml error bad zipfile on windows

Bug #506431 reported by GEM
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
Stephane Wirtel (OpenERP)

Bug Description

os : vista
openerp 5.0.7 of today
python 2.5-2
reportlab 2.3
libxml2-python-2.7.1

when I want to do a file sxw in a rml with module tiny_sxw2rml I have this error :

Traceback (most recent call last):
File "C:\Program Files\OpenERP AllInOne\Server\addons\base_report_designer\wiz
ard\tiny_sxw2rml\tiny_sxw2rml.py", line 368, in <module>
result = sxw2rml(f, xsl, output=opt.output, save_pict=False)
File "C:\Program Files\OpenERP AllInOne\Server\addons\base_report_designer\wiz
ard\tiny_sxw2rml\tiny_sxw2rml.py", line 324, in sxw2rml
res = tool.unpackNormalize(sxw_file)
File "C:\Program Files\OpenERP AllInOne\Server\addons\base_report_designer\wiz
ard\tiny_sxw2rml\tiny_sxw2rml.py", line 310, in unpackNormalize
c,s = self.oo_read(sourcefile)
File "C:\Program Files\OpenERP AllInOne\Server\addons\base_report_designer\wiz
ard\tiny_sxw2rml\tiny_sxw2rml.py", line 283, in oo_read
z = zipfile.ZipFile(fname,"r")
File "C:\Python25\lib\zipfile.py", line 346, in __init__
self._GetContents()
File "C:\Python25\lib\zipfile.py", line 366, in _GetContents
self._RealGetContents()
File "C:\Python25\lib\zipfile.py", line 378, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file

Related branches

Revision history for this message
GEM (nimp3) wrote :

solution to fix the problem :
http://openobject.com/forum/post49385.html#49385

comment line f = StringIO.StringIO(file(fname).read())
add line f = fname

Is it totally usuable in all case ?

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Can you check and provide a patch or a merge proposal ?

Thank you so much

Revision history for this message
GEM (nimp3) wrote :

i tested with multi files sxw (that I have renamed in test .sxw) of addons, and files generated in test.rml are the same than original.

But sometimes I have this warning (by example with sale->report->prepare.sxw) :

I/O warning : failed to load external entity "office.dtd"
  'office.dtd' >
                      ^
but the rml file is created correctly (it seems to me that file .dtd are unused now for the view in openerp)

Else I can confirm just for windows and v 5.0.7 built with sources of 2009-01-12 for server addons client, that i have no problem.
But sorry for the moment I have no server installed on linux and I can't confirm for this system.

Revision history for this message
GEM (nimp3) wrote :

for windows :

module :
addons\base_report_designer\wizard\tiny_sxw2rml\sxw2rml.py

line 361 :

original code :
f = StringIO.StringIO(file(fname).read())

changes :
#f = StringIO.StringIO(file(fname).read())
f = fname

Changed in openobject-addons:
milestone: none → 5.0.8
importance: Undecided → High
status: New → Confirmed
importance: High → Low
assignee: nobody → Stephane (Open ERP) (stephane-openerp)
status: Confirmed → Fix Released
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Fixed by revision 2676 (<email address hidden>)

Changed in openobject-addons:
status: Fix Released → Confirmed
status: Confirmed → Fix Released
security vulnerability: no → yes
security vulnerability: yes → no
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.