Your message dated Wed, 11 Jun 2014 10:21:29 +0000 with message-id <[email protected]> and subject line Bug#647455: fixed in python-debian 0.1.22 has caused the Debian Bug report #647455, regarding python-debian: Deb822.iter_paragraphs() claims to work on strings, but actually requires lists of strings 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 [email protected] immediately.) -- 647455: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647455 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: python-debian Version: 0.1.21 Severity: normal Tags: patch Deb822.__init__ says: :param sequence: a string, or any any object that returns a line of input each time, normally a file(). Alternately, sequence can be a dict that contains the initial key-value pairs. and iter_paragraphs says: :param sequence: same as in __init__. However, it breaks with a single string. Even the test suite passes a list of strings. Attached patch adds quick-and-dirty support for a single string.diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py index 4c5b74e..c4ad14c 100644 --- a/lib/debian/deb822.py +++ b/lib/debian/deb822.py @@ -308,6 +308,9 @@ class Deb822(Deb822Dict): necessary in order to properly interpret the strings.) """ + if isinstance(sequence, basestring): + sequence = sequence.splitlines() + if _have_apt_pkg and use_apt_pkg and isinstance(sequence, file): parser = apt_pkg.TagFile(sequence) for section in parser: diff --git a/tests/test_deb822.py b/tests/test_deb822.py index c3806bd..8f23e78 100755 --- a/tests/test_deb822.py +++ b/tests/test_deb822.py @@ -821,6 +821,16 @@ Description: python modules to work with Debian-related data formats UNPARSED_PARAGRAPHS_WITH_COMMENTS.splitlines(), use_apt_pkg=False)) self._test_iter_paragraphs_comments(paragraphs) + def test_iter_paragraphs_string_comments_use_apt_pkg(self): + paragraphs = list(deb822.Deb822.iter_paragraphs( + UNPARSED_PARAGRAPHS_WITH_COMMENTS, use_apt_pkg=True)) + self._test_iter_paragraphs_comments(paragraphs) + + def test_iter_paragraphs_string_comments_native(self): + paragraphs = list(deb822.Deb822.iter_paragraphs( + UNPARSED_PARAGRAPHS_WITH_COMMENTS, use_apt_pkg=False)) + self._test_iter_paragraphs_comments(paragraphs) + class TestPkgRelations(unittest.TestCase):
--- End Message ---
--- Begin Message ---Source: python-debian Source-Version: 0.1.22 We believe that the bug you reported is fixed in the latest version of python-debian, 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 [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. John Wright <[email protected]> (supplier of updated python-debian 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 [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Wed, 11 Jun 2014 02:25:21 -0700 Source: python-debian Binary: python-debian python3-debian Architecture: source all Version: 0.1.22 Distribution: unstable Urgency: low Maintainer: Debian python-debian Maintainers <[email protected]> Changed-By: John Wright <[email protected]> Description: python-debian - Python modules to work with Debian-related data formats python3-debian - Python 3 modules to work with Debian-related data formats Closes: 647455 689313 747031 Changes: python-debian (0.1.22) unstable; urgency=low . [ John Wright ] * Acknowledge NMUs. (Thanks for your work, Colin and Fathi!) * arfile.ArFile.extractfile: Return a matching member even if it is not the first one in the archive. Thanks to Mika Eloranta for the report and patch. (Closes: #689313) * deb822.Deb822.iter_paragraphs: Actually work with string input. Thanks to Stefano Rivera for the patch. (Closes: #647455) . [ Stuart Prescott ] * Add myself to Uploaders. * Change Vcs-* URLs to canonical locations. * Switch build system to short form dh and pybuild. * Use nose to run test suite. * Add autopkgtest test suite. . [ John Wright ] * python_support: Avoid hashlib dependency, using the built-in _sha or _sha1 module (depending on Python version) instead. That way we don't link in OpenSSL, which has an incompatible license. (Closes: 747031) Checksums-Sha1: dc079aed822a6c2caeea1d69910a22a9801e3b1d 1525 python-debian_0.1.22.dsc 5a4621439349bb81caf249d314e15ada11f4efe1 242136 python-debian_0.1.22.tar.xz 64020d68505de6a23a74314ae4c64f0a1b05dcca 61128 python-debian_0.1.22_all.deb 627cd909cdd7edf7d2d5970c2a36b773ee3f44ef 42638 python3-debian_0.1.22_all.deb Checksums-Sha256: 93cdec7fcd5425f3c7ff62170bfab3e3004e350ea532fd15ce8330ceddccdc8f 1525 python-debian_0.1.22.dsc c055dccdc5d9a762f90ce82eeab6610727cd56a29f6db2b68fce763ac5b942e0 242136 python-debian_0.1.22.tar.xz a0d55dfe79ad9c53ed8224b3e9b232a5bcae86366c5ccd89d219afe4f4063e23 61128 python-debian_0.1.22_all.deb 791e2a38235079bd3a87d9e4d2026492ff7de59e08e2f3149c33f61cb0ab9494 42638 python3-debian_0.1.22_all.deb Files: 6baced52536b4fc504a4ba7ae14b4f85 61128 python optional python-debian_0.1.22_all.deb 330c71ab76932eb1fb81069aa835981a 42638 python optional python3-debian_0.1.22_all.deb 6095ecaaca04d0ad2deceb9b05e60129 1525 python optional python-debian_0.1.22.dsc 396e1aa6bda8748628f92f44dd009c34 242136 python optional python-debian_0.1.22.tar.xz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlOYIT8ACgkQ0UIZh3p4ZWHOLQCfci9jC6rCva8Y0KpeZ+pbyaEz 1mUAnR5Kg5v3s/GQfYqlbbDnZLLusWeI =sW/c -----END PGP SIGNATURE-----
--- End Message ---
-- http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-python-debian-maint
