Bug#462859: debfile fails for packages using data.tar.bz2

Cameron Dale camrdale at gmail.com
Wed Feb 20 18:00:55 UTC 2008


On 2/20/08, Stefano Zacchiroli <zack at debian.org> wrote:
>  The problem in fixing the access to data.tar.bz2 is that the Python
>  class BZ2File does not work as GZFile: in particular it does not accept
>  a file object as input, but rather requires a file*name*. So I see 2
>  solutions:

I thought of another solution that I add to the discussion, though I
am not a python-debian developer:

4) Use the tarfile module to handle the decompression. According to
   the documentation, it can also take a file-like object fileobj as
   input, and specifying "r:bz2" (or just "r" for compression-detection)
   is supposed to work on compressed tar files. (I say supposed, because
   I was not able to get it to work, but that might just be me.)

Of the other solutions, I think implementing (2) by creating a wrapper
file-like class around the bz2 incremental decompressor
BZ2Decompressor is a good and fairly easy solution. Although my
initial problem would be solved by (3) since I don't need access to
the contents of the deb's data file.

Thanks,
Cameron





More information about the pkg-python-debian-maint mailing list