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


Groups > comp.lang.python > #8384

unzip problem

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <shahmed@sfwmd.gov>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.045
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'received:141': 0.03; 'ioerror:': 0.09; "'rb')": 0.16; 'subject:problem': 0.19; '(most': 0.21; 'traceback': 0.25; 'skip:" 30': 0.28; 'script': 0.29; 'hi,': 0.30; 'print': 0.32; 'file.': 0.32; 'error': 0.33; 'to:addr :python-list': 0.34; 'last):': 0.35; 'file': 0.36; 'charset:us- ascii': 0.36; 'idea': 0.36; 'skip:o 20': 0.36; 'getting': 0.38; 'help': 0.39; 'to:addr:python.org': 0.39; 'appreciated.': 0.40; 'skip:z 10': 0.40; 'here:': 0.64
X-MimeOLE Produced By Microsoft Exchange V6.5
Content-class urn:content-classes:message
MIME-Version 1.0
Content-Type multipart/mixed; boundary="----_=_NextPart_001_01CC327E.D04D461B"
Subject unzip problem
Date Fri, 24 Jun 2011 10:55:52 -0400
X-MS-Has-Attach
X-MS-TNEF-Correlator <9FF28245399DBC4F83C1BB6EA57CA4EC3601@EXCHVS01.ad.sfwmd.gov>
Thread-Topic unzip problem
Thread-Index AcwyftBXy1nTDmkETl622tLPCmDl5Q==
From "Ahmed, Shakir" <shahmed@sfwmd.gov>
To <python-list@python.org>
X-Virus-Scanned ClamAV 0.96.1/13236/Thu Jun 23 22:49:29 2011
X-Virus-Status Clean
X-Scanned-By MIMEDefang 2.70 on 141.232.3.26
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.371.1308928216.1164.python-list@python.org> (permalink)
Lines 155
NNTP-Posting-Host 82.94.164.166
X-Trace 1308928216 news.xs4all.nl 14138 [::ffff:82.94.164.166]:35096
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8384

Show key headers only | 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