Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'binary': 0.07; 'subject:file': 0.07; '"r"': 0.09; 'parameter': 0.09; 'cc:addr :python-list': 0.11; 'suggest': 0.14; "'r'": 0.16; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'record,': 0.16; 'skip:z 30': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'mode': 0.30; 'file': 0.32; 'probably': 0.32; 'open': 0.33; "i'd": 0.34; 'one,': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'should': 0.36; 'dave': 0.60; 'skip:z 20': 0.60; 'you.': 0.62; 'received:50.22': 0.84; 'angel': 0.91 Date: Fri, 19 Apr 2013 15:45:49 -0500 From: Tim Chase To: Dave Angel Subject: Re: unzipping a zipx file In-Reply-To: <5171A946.9090609@davea.name> References: <5171A946.9090609@davea.name> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366404264 news.xs4all.nl 2169 [2001:888:2000:d::a6]:60062 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43936 On 2013-04-19 16:29, Dave Angel wrote: > > zFile = zipfile.ZipFile(fullPathName,'r') > > The second parameter to ZipFile() probably should be 'rb' not 'r' Just for the record, the zipfile.ZipFile.__init__ maps "r" to open the file with "rb", so that's not the issue. Your suggestion about opening the file to write in binary mode is a good one, but I'd just suggest using ZipFile.extract(...) which is built in and takes care of writing the file for you. :-) -tkc