pkg.candidate.fetch_source() fails with ValueError

Bug #552400 reported by Mike Pontillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-apt

Even though I can successfully use "apt-get source" to get a source package, I can't get python-apt to do the same.

Note, this is a regression from Karmic.

Example test case:

>>> import apt
>>> c = apt.cache.Cache()
>>> p = c["coreutils"]
>>> p.candidate.fetch_source()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/apt/package.py", line 546, in fetch_source
    raise ValueError("No source for %r" % self)
ValueError: No source for <Version: package:'coreutils' version:'7.4-2ubuntu2'>
>>> ^D

$ apt-get source coreutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 9,730kB of source archives.
Get:1 http://archive.ubuntu.com/ubuntu/ lucid/main coreutils 7.4-2ubuntu2 (dsc) [1,883B]
Get:2 http://archive.ubuntu.com/ubuntu/ lucid/main coreutils 7.4-2ubuntu2 (tar) [9,709kB]
Get:3 http://archive.ubuntu.com/ubuntu/ lucid/main coreutils 7.4-2ubuntu2 (diff) [19.2kB]
Fetched 9,730kB in 6s (1,415kB/s)
gpgv: Signature made Thu 04 Mar 2010 07:06:20 PM PST using RSA key ID 140C6664
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./coreutils_7.4-2ubuntu2.dsc
dpkg-source: info: extracting coreutils in coreutils-7.4
dpkg-source: info: unpacking coreutils_7.4.orig.tar.gz
dpkg-source: info: applying coreutils_7.4-2ubuntu2.diff.gz

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: python-apt 0.7.94.2ubuntu4
ProcVersionSignature: Ubuntu 2.6.32-17.26-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-17-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Wed Mar 31 00:49:40 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100318)
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: python-apt

Revision history for this message
Mike Pontillo (mpontillo) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.94.2ubuntu5

---------------
python-apt (0.7.94.2ubuntu5) lucid; urgency=low

  [ Julian Andres Klode ]
  * apt/package.py:
    - Decode using utf-8 in installed_files (LP: #407953).
    - Fix fetch_source() to work when source name = binary name (LP: #552400).
  * python/cache.cc:
    - Check that 2nd argument to Cache.update() really is a SourceList object.
  * python/generic.cc:
    - Map ArchiveURI property to archive_uri
  * utils/migrate-0.8.py:
    - Open files in universal newline support and pass filename to ast.parse.
    - Add has_key to the list of deprecated functions.
    - Don't abort if parsing failed.
    - do not require files to end in .py if they are passed on the command
      line or if they contain python somewhere in the shebang line.
 -- Michael Vogt <email address hidden> Wed, 31 Mar 2010 22:11:38 +0200

Changed in python-apt (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.