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

Bug#383617: Please support parsing tagfiles from gzip.open()



On Fri, Aug 18, 2006 at 12:54:22PM +0200, Jeroen van Wolffelaar wrote:
> Package: python-apt
> Version: 0.5.10
> Severity: wishlist
> 
> (but also verified in 0.6.19)
> 
> One cannot feed a gzip.open()'d file into apt_pkg.ParseTagFile(). This
> would be a convenient feature. ParseTagFile says:
> 
> TypeError: argument 1 must be file, not instance
> 
> I'm unfortunately too unaware of the details of filedescriptors in
> python to know how to best resolve this.

Just a small update on this issue. The 'jak' branch contains a patch which
allows you to pass a GzipFile() object to all file-using functions. But it
won't work because the GzipFile() object's fileno() method refers to the
descriptor of the compressed file. Any attempt to use it would therefore
fail.

And sys.stdin does not work as well for some functions, but support for
custom file-like objects has increased (It was needed for Python 3 port,
where THE file object does not exist anymore).

-- 
Julian Andres Klode  - Free Software Developer
   Debian Developer  - Contributing Member of SPI
   Ubuntu Member     - Fellow of FSFE

Website: http://jak-linux.org/   XMPP: juliank@jabber.org
Debian:  http://www.debian.org/  SPI:  http://www.spi-inc.org/
Ubuntu:  http://www.ubuntu.com/  FSFE: http://www.fsfe.org/



Reply to: