unzip problem

Ahmed, Shakir shahmed at sfwmd.gov
Fri Jun 24 10:55:52 EDT 2011


Hi,

 

I am getting following error message while unziping a .zip file. Any
help or idea is highly appreciated.

 

Error message>>>

Traceback (most recent call last):

  File "C:\Zip_Process\py\test2_new.py", line 15, in <module>

    outfile.write(z.read(name))

IOError: (22, 'Invalid argument')

 

 

The script is here:

*****************************

fh = open('T:\\test\\*.zip', 'rb')

z = zipfile.ZipFile(fh)

for name in z.namelist():

    outfile = open(name, 'wb')

 

    outfile.write(z.read(name))

    print z

    print outfile

    outfile.close()

 

fh.close()

********************************

 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4958 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20110624/d78fe7a2/attachment.bin>


More information about the Python-list mailing list