Skip Montanaro <skip at pobox.com> added the comment: Your output file should be opened in binary mode. Sounds like you opened it in text mode. ---------- nosy: +skip.montanaro _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue7198> _______________________________________