[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#704594: ITP: python-arpy -- library for accessing the archive files and reading the contents



On Wed, Apr 03, 2013 at 03:22:17PM +0200, Christoph Egger wrote:
>   The 1.0.0 I intent to use can read ar from any file handle and should
> therefore be able to provide exactly that. I have successfully used it
> to handle bzip2 compressed ar-archives using python's bzip2 module.

This is because the bz2 module supports seeking. A pipe usually does not
support seeking. Try reading from sys.stdin. I had to write my own ar
implementation for dedup.debian.net[1], because all the ones around
including arpy suck at streams. It really is not that hard to get this
right. So I ask you to delay uploading arpy to Debian until upstream has
fixed their API to support streaming reads.

Here is a test case to see the brokenness:

cat test/bsd_mixed.ar | python -c 'import arpy, sys; print(arpy.Archive(fileobj=sys.stdin).read_next_header())' 

Helmut

[1] You can find the source in the git repo mentioned on the site and I
    can relicense it for inclusion into arpy, but it is fairly minimal
    to just support the bits that I needed. But then again arpy is
    pretty minimal too.


Reply to: