From: Chris Rebert on 21 Jun 2010 22:18 On Mon, Jun 21, 2010 at 5:32 PM, Ameet Nanda <ameet.nanda(a)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
|
Pages: 1 Prev: float from numbers in text file Next: Redirecting STDOUT to a Python Variable |