tag 383617 + wontfix
thanks

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.
The problem is that apt_pkg requires a file descriptor, and this is
only available for file objects.

GzipFile and other classes written in Python simply emulate the 
behaviour of a real file for Python applications, but provide no
file descriptor for the uncompressed data.

You can work around this problem by writing the data into a temporary
file, see tempfile.TemporaryFile[1] for more information.

[1] http://docs.python.org/library/tempfile.html
-- 
Julian Andres Klode  - Free Software Developer
   Debian Developer  - Contributing Member of SPI
   Ubuntu Member     - Fellow of FSFE

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

Attachment: signature.asc
Description: Digital signature

Reply via email to