Problem using pbzip2 with bz2.BZ2File().read()
Chris Rebert
clp2 at rebertia.com
Mon Jun 21 22:18:47 EDT 2010
On Mon, Jun 21, 2010 at 5:32 PM, Ameet Nanda <ameet.nanda at gmail.com> wrote:
> When I compress a file with bzip2 from command line and read it with
> uncomp_data = bz2.BZ2File("fname").read() , it reads the whole file into
> uncomp_data.
>
> However when I compress the file with pbzip2 from command line and read it
> in a similar way it just reads the block size of data used for compression.
Read this recent nearly identical thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/be7d22a97b219a05
The `bz2` std lib module doesn't support multiple streams and thus
doesn't support files produced by pbzip2.
It's a known bug: http://bugs.python.org/issue1625
Cheers,
Chris
--
What's with everyone using pbzip2 all of a sudden??
http://blog.rebertia.com
More information about the Python-list
mailing list