Bug#627058: python-debian: deb822.GpgInfo.from_file is all broken
Julien Cristau
jcristau at debian.org
Tue May 17 10:31:53 UTC 2011
Package: python-debian
Version: 0.1.18
Severity: normal
Tags: patch
Two problems with GpgInfo:
1. from_file calls from_sequence instead of GpgInfo.from_sequence,
resulting in:
File "/usr/lib/pymodules/python2.6/debian/deb822.py", line 685, in from_file
return from_sequence(file(target), *args)
NameError: global name 'from_sequence' is not defined
2. from_sequence wants non-\n-terminated lines in the sequence, otherwise
it sends bogus data to gpgv (thanks to the "\n".join(sequence) sent to
the pipe). the sequence returned by file(foo) has \n at the end of
each line.
Works a lot better with:
diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index a0cad69..163fc5f 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
@@ -682,7 +682,7 @@ class GpgInfo(dict):
@staticmethod
def from_file(target, *args):
"""Create a new GpgInfo object from the given file, calls from_sequence(file(target), *args)"""
- return from_sequence(file(target), *args)
+ return GpgInfo.from_sequence(file(target).read(), *args)
###
Although you might want to fix from_sequence instead.
Incidentally it would be nice to be able to pass a list of keyrings to
Deb822.get_gpg_info().
Cheers,
Julien
-- System Information:
Debian Release: 6.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-debian depends on:
ii python 2.6.6-3+squeeze6 interactive high-level object-orie
ii python-chardet 2.0.1-1 universal character encoding detec
ii python-support 1.0.10 automated rebuilding support for P
Versions of packages python-debian recommends:
ii python-apt 0.7.100.1 Python interface to libapt-pkg
Versions of packages python-debian suggests:
ii gpgv 1.4.10-4 GNU privacy guard - signature veri
-- no debconf information
More information about the pkg-python-debian-maint
mailing list