This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Error when using PyZipFile to create archive
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: crc1021, dkuhlman, nnorwitz
Priority: normal Keywords:

Created on 2003-03-17 23:05 by dkuhlman, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (4)
msg15177 - (view) Author: Dave Kuhlman (dkuhlman) Date: 2003-03-17 23:05
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.

msg15178 - (view) Author: Dave Kuhlman (dkuhlman) Date: 2003-04-03 01:34
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.
msg15179 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-05-22 21:22
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.
msg15180 - (view) Author: Eric Lofstad (crc1021) Date: 2003-09-18 02:33
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
History
Date User Action Args
2022-04-10 16:07:42adminsetgithub: 38174
2003-03-17 23:05:01dkuhlmancreate