Issue 705295: Error when using PyZipFile to create archive (original) (raw)
I get the following trace back while using the PyZipFile class to create zip import files.
Traceback (most recent call last): File "../fsmGenerate.py", line 125, in ? main() File "../fsmGenerate.py", line 121, in main generate(inFileName, outName, app, gui, schema, zip) File "../fsmGenerate.py", line 56, in generate outZip.write(name) File "/usr/local/lib/python2.3/zipfile.py", line 427, in write self.fp.write(zinfo.FileHeader()) File "/usr/local/lib/python2.3/zipfile.py", line 167, in FileHeader fileHeader = '%s%s%s' % (header, self.filename, self.extra) UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 10: ordinal not in range(128)
This error occurs intermitently. It seems to be related to the time.
Looking in file Lib/zipfile.py, it appears that the call to struct.pack() in method ZipInfo.FileHeader() is creating a string containing bytes with values > 0x7F. I believe that these values are coming from local variable dostime in ZipInfo.FileHeader().
I'm using Python 2.3a2, built from source on Linux.