Jerry Hill wrote: > On 6/27/07, Robert Rawlins - Think Blue > <[EMAIL PROTECTED]> wrote: >> zip = zipfile.ZipFile('Media/Media.zip', 'r') > > Shouldn't you open this file in binary mode? It shouldn't make > any difference on unix machines, but will possibly break under > windows. That may also explain why it works properly in one > environment, and not in another. >
It wouldn't hurt, but ... Actually, it is the underlying file that should be opened in binary mode. I just looked at the source for the zipfile module. It throws away the 'b' if the mode contains a 'b'. If you pass it a file name, zipfile always opens the underlying file in binary mode. If you pass in a file, then it is your responsibility to open that file in binary mode. Dave -- http://www.rexx.com/~dkuhlman -- http://mail.python.org/mailman/listinfo/python-list