zip/unzip pictures doesn't work

Erik Max Francis max at alcyone.com
Sat Nov 9 05:49:12 EST 2002


A Nilsson wrote:

> I've been messing around with the zipfile module and discovered
> something strange.
> When I zip/unzip ordinary text files there's no problem but when i use
> pictures (JPG and GIF) they get corrupted. I believe it is during the
> unzip operation they get messed up.

Sniff, sniff.  I smell a text/binary distinction (and I see you're on
Windows).  Make sure you open the relevant files in binary mode by
appending a 'b' character to the mode string.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Success and failure are equally disastrous.
\__/ Tennessee Williams
    The laws list / http://www.alcyone.com/max/physics/laws/
 Laws, rules, principles, effects, paradoxes, etc. in physics.



More information about the Python-list mailing list