Bug#457854: python-debian: PackageFile class yields objects of different types

Antonio Terceiro terceiro at softwarelivre.org
Wed Dec 26 14:31:32 UTC 2007


Package: python-debian
Version: 0.1.8
Severity: normal
Tags: patch

the PackageFile example currently crashes with a TypeError:

terceiro at morere:~$ python /usr/share/doc/python-debian/examples/packages/grep-maintainer terceiro
Traceback (most recent call last):
  File "/usr/share/doc/python-debian/examples/packages/grep-maintainer", line 26, in ?
    if maint_RE.search(pkg['maintainer']):
TypeError: list indices must be integers

This happens because the __yield__ method in PackageFile class has two yield
statements, one 'yield pkg' and other 'yield dict(pkg)'.

The attached patch fixes the problem by putting dict() around 'pkg' in the
first yield.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-1-686 (SMP w/1 CPU core)
Locale: LANG=pt_BR.utf8, LC_CTYPE=pt_BR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-debian depends on:
ii  python                        2.4.4-6    An interactive high-level object-o
ii  python-support                0.7.5      automated rebuilding support for p

python-debian recommends no packages.

-- no debconf information

-- 
Antonio Terceiro <terceiro at softwarelivre.org>
http://people.softwarelivre.org/~terceiro/
GnuPG ID: 0F9CB28F


-------------- next part --------------
A non-text attachment was scrubbed...
Name: python-debian-packagefile-yield-objects-of-same-type.diff
Type: text/x-diff
Size: 497 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20071226/b70b317e/attachment.diff 


More information about the pkg-python-debian-maint mailing list