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

Bug#710541: marked as done (python-apt: "key in apt.debfile.DebPackage(...)" doesn't work)



Your message dated Thu, 06 Jun 2013 17:33:20 +0000
with message-id <E1Uke3s-0007tW-Id@franck.debian.org>
and subject line Bug#710541: fixed in python-apt 0.8.9.1
has caused the Debian Bug report #710541,
regarding python-apt: "key in apt.debfile.DebPackage(...)" doesn't work
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
710541: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710541
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: python-apt
Version: 0.8.9
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch saucy

  >>> import apt.debfile
  >>> deb = apt.debfile.DebPackage("man-db_2.6.3-6_i386.deb")
  >>> deb["Version"]
  '2.6.3-6'
  >>> "Version" in deb
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3/dist-packages/apt/debfile.py", line 73, in __getitem__
      return self._sections[key]
  TypeError: Argument must be str.

This is pretty surprising; it turns out that, lacking __contains__,
Python falls back to trying to treat the object as a sequence, but
deb[0] of course doesn't work.  Patch follows.

=== modified file 'apt/debfile.py'
--- apt/debfile.py	2012-10-01 14:32:35 +0000
+++ apt/debfile.py	2013-05-31 17:54:59 +0000
@@ -72,6 +72,9 @@ class DebPackage(object):
     def __getitem__(self, key):
         return self._sections[key]
 
+    def __contains__(self, key):
+        return key in self._sections
+
     @property
     def filelist(self):
         """return the list of files in the deb."""

=== modified file 'tests/test_debfile.py'
--- tests/test_debfile.py	2012-11-20 08:44:23 +0000
+++ tests/test_debfile.py	2013-05-31 17:14:57 +0000
@@ -133,6 +133,10 @@ Description: testpackage for gdebi - con
 	# we need to support python2.6
         self.assertTrue(raised)
 
+    def test_contains(self):
+        deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb")
+        self.assertTrue("Package" in deb)
+
 
 if __name__ == "__main__":
     #logging.basicConfig(level=logging.DEBUG)

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]

--- End Message ---
--- Begin Message ---
Source: python-apt
Source-Version: 0.8.9.1

We believe that the bug you reported is fixed in the latest version of
python-apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 710541@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated python-apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 06 Jun 2013 18:32:14 +0200
Source: python-apt
Binary: python-apt python-apt-doc python-apt-dbg python-apt-dev python-apt-common python3-apt python3-apt-dbg
Architecture: source amd64 all
Version: 0.8.9.1
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description: 
 python-apt - Python interface to libapt-pkg
 python-apt-common - Python interface to libapt-pkg (locales)
 python-apt-dbg - Python interface to libapt-pkg (debug extension)
 python-apt-dev - Python interface to libapt-pkg (development files)
 python-apt-doc - Python interface to libapt-pkg (API documentation)
 python3-apt - Python 3 interface to libapt-pkg
 python3-apt-dbg - Python 3 interface to libapt-pkg (debug extension)
Closes: 710541
Changes: 
 python-apt (0.8.9.1) unstable; urgency=low
 .
   [ Michael Vogt ]
   * debian/control:
     - updated Vcs field to point to
       http://git.debian.org/git/apt/python-apt.git
   * replace .bzr-builddeb/default.conf with debian/gbp.conf
 .
   [ Julian Andres Klode ]
   * Update the Vcs fields to use Vcs-Git with git protocol, and gitweb
     for Vcs-Browser
 .
   [ Colin Watson ]
   * add support for "key in apt.debfile.DebPackage" (closes: #710541)
Checksums-Sha1: 
 7a1ac0b0210c6b75222590de3a88085195b56add 1608 python-apt_0.8.9.1.dsc
 0e529282ddd9f1c73c7190fa5beeea4a814ff036 403807 python-apt_0.8.9.1.tar.gz
 83aa7a7b544ed1b3be47459b34ca8e13f2bc95f0 198966 python-apt_0.8.9.1_amd64.deb
 e6c15bc22c66c048118a3637ee90b1e821627753 250166 python-apt-doc_0.8.9.1_all.deb
 68d149842b9772c04bd0d6d3ecc3c91911832996 2146836 python-apt-dbg_0.8.9.1_amd64.deb
 b9ea4f3bae0df3958d4388df3a745ed4fe2006c2 7638 python-apt-dev_0.8.9.1_all.deb
 bca7fd305391ea23c44ad4ea1d56a731fac86c8f 114810 python-apt-common_0.8.9.1_all.deb
 57c49a8c3d3a5081389b980396b2ff02b2ec2bc6 314666 python3-apt_0.8.9.1_amd64.deb
 b787a4d95da83b55a625a400621cd7350cd62b1a 4284314 python3-apt-dbg_0.8.9.1_amd64.deb
Checksums-Sha256: 
 50ea63cf46382eea1e43ec1edbf1fb2084acdf4c286f761c05f278f645f9f36d 1608 python-apt_0.8.9.1.dsc
 a1c473555294d555176f2dfe599967b405efffd108d93e79fe1a3f7205a96fe9 403807 python-apt_0.8.9.1.tar.gz
 7c382e72b1f1d9c606369ffeca0e2af8de59037b4cca2b4e7dc9b8807a49ae14 198966 python-apt_0.8.9.1_amd64.deb
 f682a2da849196d45a846fc4a4f5a75d596bc951e095f30af49cb901c0887c96 250166 python-apt-doc_0.8.9.1_all.deb
 90cb1810c6aecfa14aeb0352c6965eb4a318870350b65554b9a80237a0112693 2146836 python-apt-dbg_0.8.9.1_amd64.deb
 94eec276952fb373517c6e0c609c5633aa1fe06d7c4984166cde6122f2d14830 7638 python-apt-dev_0.8.9.1_all.deb
 e1719f5f22b651450a3b4e9ef36a785a2d2ad28e0861f2d261403e258c4a0dbe 114810 python-apt-common_0.8.9.1_all.deb
 6f4c8828030fe0800664c00795f03fa0b1d662daf6c1b25d9ef158ff726916c6 314666 python3-apt_0.8.9.1_amd64.deb
 cf04e1828e58713cfafec8c9df28f79e70da89fae313e7e667e4c55dd84fe795 4284314 python3-apt-dbg_0.8.9.1_amd64.deb
Files: 
 2f11b9e595858506d8299c05e0b6acb5 1608 python standard python-apt_0.8.9.1.dsc
 b5870b33e897aaab77f268f13041acfd 403807 python standard python-apt_0.8.9.1.tar.gz
 85004c67f3b1f922a9a30b4c6cfd35c2 198966 python standard python-apt_0.8.9.1_amd64.deb
 da6621507a5e9659de0a921a8762a2dd 250166 doc optional python-apt-doc_0.8.9.1_all.deb
 316ba67932188eebc514f7f2c23a43b7 2146836 debug extra python-apt-dbg_0.8.9.1_amd64.deb
 32fbd5ba88ad4eb5da9645cf235100f9 7638 python optional python-apt-dev_0.8.9.1_all.deb
 6a7b6f85f74777de411cc1f8b024044f 114810 python optional python-apt-common_0.8.9.1_all.deb
 214fce0070365018543e8f91906c5e7a 314666 python optional python3-apt_0.8.9.1_amd64.deb
 633c514c2fdb39c40635d0f8789c7f7d 4284314 debug extra python3-apt-dbg_0.8.9.1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlGww0gACgkQliSD4VZixzS1sgCgmcGXVmZxXGHknWylsgN5ROLD
8MEAoIwXWKr2V6O1qG6vbMAtBOOeZt44
=W9m5
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: