[Python-bugs-list] [ python-Bugs-705295 ] Error when using PyZipFile to create archive
SourceForge.net
noreply@sourceforge.net
Wed, 02 Apr 2003 17:34:23 -0800
Bugs item #705295, was opened at 2003-03-17 15:05
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=705295&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Kuhlman (dkuhlman)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error when using PyZipFile to create archive
Initial Comment:
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.
----------------------------------------------------------------------
>Comment By: Dave Kuhlman (dkuhlman)
Date: 2003-04-02 17:34
Message:
Logged In: YES
user_id=629965
I can no longer reproduce this bug. I'm the one who originally submitted this bug report. There must have been a bug in my original code. The test I'm using now executes with no problems.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=705295&group_id=5470