unzipping a zipx file

Tim Chase python.list at tim.thechases.com
Fri Apr 19 16:45:49 EDT 2013


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





More information about the Python-list mailing list