[issue10900] bz2 module fails to uncompress large files

Charles-Francois Natali report at bugs.python.org
Wed Mar 2 08:55:40 CET 2011


Charles-Francois Natali <neologix at free.fr> added the comment:

2011/3/2 Eric Wolf <report at bugs.python.org>:
>
> Eric Wolf <ebwolf at gmail.com> added the comment:
>
> I just got confirmation that OSM is using pbzip2 to generate these files. So they are multi-stream. At least that gives a final answer but doesn't solve my problem.
>

At least on Unix, you can use this workaround:

-        self.fp = bz2.BZ2File(filename,'rb',16384*64)
+       self.fp = os.popen('bzip2 -cd ' + filename)

It's ugly, not as portable, but it should work on any Unix with bzip2
installed (and supporting multi-stream files).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10900>
_______________________________________


More information about the Python-bugs-list mailing list