Re: unzipping a zipx file

Discussion in 'Python' started by Dave Angel, Apr 19, 2013.

  1. Dave Angel

    Dave Angel Guest

    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
     
    Dave Angel, Apr 19, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug Tolton

    File unzipping

    Doug Tolton, Dec 9, 2003, in forum: Python
    Replies:
    0
    Views:
    293
    Doug Tolton
    Dec 9, 2003
  2. webcomm
    Replies:
    10
    Views:
    736
    John Machin
    Jan 10, 2009
  3. b_erickson1

    unzipping a zipx file

    b_erickson1, Apr 19, 2013, in forum: Python
    Replies:
    4
    Views:
    157
    Dave Angel
    Apr 20, 2013
  4. Tim Chase

    Re: unzipping a zipx file

    Tim Chase, Apr 19, 2013, in forum: Python
    Replies:
    0
    Views:
    109
    Tim Chase
    Apr 19, 2013
  5. Serhiy Storchaka

    Re: unzipping a zipx file

    Serhiy Storchaka, Apr 20, 2013, in forum: Python
    Replies:
    0
    Views:
    130
    Serhiy Storchaka
    Apr 20, 2013
Loading...

Share This Page