Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8384

unzip problem

Subject unzip problem
Date 2011-06-24 10:55 -0400
From "Ahmed, Shakir" <shahmed@sfwmd.gov>
Newsgroups comp.lang.python
Message-ID <mailman.371.1308928216.1164.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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()

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

 

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

unzip problem "Ahmed, Shakir" <shahmed@sfwmd.gov> - 2011-06-24 10:55 -0400
  Re: unzip problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-24 15:33 +0000
    RE: unzip problem "Ahmed, Shakir" <shahmed@sfwmd.gov> - 2011-06-24 13:23 -0400
      RE: unzip problem steve+comp.lang.python@pearwood.info - 2011-06-25 03:55 +1000

csiph-web