On Wed, Apr 10, 2013 at 8:18 PM, Rodney Lewis <therealdotcom...@gmail.com> wrote: > My question is at StackOverflow so I won't repeat it here.
Short link: http://stackoverflow.com/q/15938629/205580 Your function worked fine for me on Windows Python 2.7.3, compressing/decompressing a text file that's about 150 KiB. The bz2 module raises IOError("invalid data stream") for the error codes BZ_DATA_ERROR and BZ_DATA_ERROR_MAGIC: http://hg.python.org/cpython/file/70274d53c1dd/Modules/bz2module.c#l192 According to the bzip2 docs, BZ_DATA_ERROR is raised when the computed CRC fails to match the stored CRC, or there's some other anomaly in the data. BZ_DATA_ERROR_MAGIC means the compressed data didn't start with the 'BZh' magic bytes. http://www.bzip.org/1.0.5/bzip2-manual-1.0.5.html#err-handling _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor