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


Groups > comp.lang.python > #43935 > unrolled thread

Re: unzipping a zipx file

Started byDave Angel <davea@davea.name>
First post2013-04-19 16:29 -0400
Last post2013-04-19 16:29 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: unzipping a zipx file Dave Angel <davea@davea.name> - 2013-04-19 16:29 -0400

#43935 — Re: unzipping a zipx file

FromDave Angel <davea@davea.name>
Date2013-04-19 16:29 -0400
SubjectRe: unzipping a zipx file
Message-ID<mailman.840.1366403429.3114.python-list@python.org>
On 04/19/2013 01:59 PM, b_erickson1 wrote:
> I have python 2.6.2 and I trying to get it to unzip a file made with winzip pro.  The file extension is zipx.  This is on a windows machine where I have to send them all that files necessary to run.  I am packaging this with py2exe.  I can open the file with
> zFile = zipfile.ZipFile(fullPathName,'r')
> and I can look through all the file in the archive
> for filename in zFile.namelist():
> but when I write the file out with this code:
>              ozFile = open(filename,'w')
>              ozFile.write(zFile.read(filename))
>              ozFile.close()
> that file still looks encrypted.  No errors are thrown.  The file is just a text file not a jpeg or anything else.  I can open the file with 7zip and extract the text file out just fine.
>
>
> What am I missing?
>
> Thanks
>

The second parameter to ZipFile() probably should be 'rb' not 'r'

Likewise, I'd suggest using 'wb' on the output file, though that's not 
your problem here.

-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web