[Python-bugs-list] [ python-Bugs-705295 ] Error when using
PyZipFile to create archive
SourceForge.net
noreply at sourceforge.net
Wed Sep 17 22:33:22 EDT 2003
Bugs item #705295, was opened at 2003-03-17 17:05
Message generated for change (Comment added) made by crc1021
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: Closed
Resolution: Invalid
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: Eric Lofstad (crc1021)
Date: 2003-09-17 21:33
Message:
Logged In: YES
user_id=868802
I get a similar error when the filename passed to "write" is
a unicode string. I'm using Python 2.3
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-05-22 16:22
Message:
Logged In: YES
user_id=33168
I'm closing this bug report since it can't be reproduced.
If you have another bug, please open a new bug report.
----------------------------------------------------------------------
Comment By: Dave Kuhlman (dkuhlman)
Date: 2003-04-02 19: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
More information about the Python-bugs-list
mailing list