Bug#438804: [debfile] DebFile.md5sums doesn't work in Python 2.4

Romain Francoise rfrancoise at debian.org
Sun Aug 19 20:15:13 UTC 2007


Package: python-debian
Version: 0.1.5

First of all apologies in advance for filing only one bug about two
issues, but the first one is trivial and related to the second.

The first issue is that the 'md5sums' method of the DebFile class
probably wants to return self.control.md5sums() instead of
self.control.md5sums, which is the method itself.

>>> from debian_bundle.debfile import DebFile
>>> DebFile('/tmp/1.deb').md5sums()
<bound method DebControl.md5sums of <debian_bundle.debfile.DebControl object at 0x2adeecf62e50>>
>>> DebFile('/tmp/1.deb').md5sums()()
{'usr/share/lintian/overrides/emacs-snapshot-gtk': ... }

The other issue is that while this method works fine in Python 2.5,
it doesn't in Python 2.4 because the file objects returned by
tarfile.extractfile() aren't iterators like regular file objects.
(That's a new feature in Python 2.5.)

>>> from debian_bundle.debfile import DebFile
>>> DebFile('/tmp/1.deb').md5sums()()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/var/lib/python-support/python2.4/debian_bundle/debfile.py", line 165, in md5sums
    for line in md5_file:
TypeError: iteration over non-sequence
>>>

Thanks,

-- 
  ,''`.
 : :' :        Romain Francoise <rfrancoise at debian.org>
 `. `'         http://people.debian.org/~rfrancoise/
   `-




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