Title: Error when using PyZipFile to create archive
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
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 2003-09-18 02:33 by crc1021. 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 "../", line 125, in ?
  File "../", line 121, in main
    generate(inFileName, outName, app, gui, schema, zip)
  File "../", line 56, in generate
  File "/usr/local/lib/python2.3/", line 427, in write
  File "/usr/local/lib/python2.3/", 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/, 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 

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 

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 

I get a similar error when the filename passed to "write" is
a unicode string.  I'm using Python 2.3
Date User Action Args
2003-03-17 23:05:01dkuhlmancreate