Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock
Dear Release Team,
There are two important bugs in python-debian that I would like to fix in
buster. I don't think the changes are sufficiently large or problematic to
prevent that, but I seek your pre-approval for them prior to uploading
(diff against 0.1.34 attached).
* debian_support.PackageFile is completely broken with non-ASCII Packages
and Sources files when used with Python 3. (#928655)
* when processing debian/copyright files, NotMachineReadableError is not
raised when the file is not copyright-format/1.0. (not filed in the bts,
MR submitted directly, would be severity:important since it makes the
debian.copyright module almost unusable for consumers like
sources.debian.net)
There are additionally two other minor bugs that are already fixed in git.
Fixing them seems reasonable to me but your input is sought.
* Stop using the deprecated autopkgtest needs-recommends restriction.
* Prevent accidental overwriting of abc.Mapping and typing.Mapping with
Python 3.
regards
Stuart
unblock python-debian/0.1.35
-- System Information:
Debian Release: 10.0
APT prefers testing
APT policy: (550, 'testing'), (500, 'testing-proposed-updates'), (500,
'testing-debug'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8),
LANGUAGE=en_AU:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff --git a/debian/changelog b/debian/changelog
index 5d1db94..60d9f95 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+python-debian (0.1.35) unstable; urgency=medium
+
+ [ Stuart Prescott ]
+ * Fix decode error when using debian_support.PackageFile by allowing the
+caller to specify an encoding, defaulting to UTF-8 (Closes: #928655).
+ * Remove needs-recommends from autopkgtest definitions.
+
+ [ Jan Teske ]
+ * Fix overwriting of names in importing abc.Mapping and typing.Mapping.
+
+ [ Jelmer Vernooij ]
+ * Correctly raise NotMachineReadableError when no format is set.
+
+ -- Stuart Prescott Thu, 30 May 2019 00:23:06 +1000
+
python-debian (0.1.34) unstable; urgency=medium
[ Jelmer Vernooij ]
diff --git a/debian/tests/control b/debian/tests/control
index ecb50a4..386071d 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,17 +1,19 @@
Tests: python3-debian
-Restrictions: allow-stderr needs-recommends
+Restrictions: allow-stderr
Depends:
binutils (>= 2.23),
python3-all,
+ python3-apt,
python3-debian,
debian-keyring,
debian-archive-keyring
Tests: python-debian
-Restrictions: allow-stderr needs-recommends
+Restrictions: allow-stderr
Depends:
binutils (>= 2.23),
python2.7,
+ python-apt,
python-debian,
python-unittest2,
debian-keyring,
diff --git a/lib/debian/copyright.py b/lib/debian/copyright.py
index cfe587b..d360784 100644
--- a/lib/debian/copyright.py
+++ b/lib/debian/copyright.py
@@ -639,7 +639,7 @@ class Header(deb822.RestrictedWrapper):
super(Header, self).__init__(data)
fmt = self.format # type: ignore
-if fmt != _CURRENT_FORMAT:
+if fmt != _CURRENT_FORMAT and fmt is not None:
# Add a terminal slash onto the end if missing
if not fmt.endswith('/'):
fmt += "/"
diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index 3dbd41c..0686cdb 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
@@ -222,16 +222,11 @@ from __future__ import absolute_import, print_function
import collections
try:
# Python 3
-from collections.abc import (
-Mapping,
-MutableMapping,
-)
+import collections.abc as collections_abc
except ImportError:
# Python 2.7 cruft
-from collections import (
-Mapping,
-MutableMapping,
-)
+# pylint: disable=reimported
+import collections as collections_abc# type: ignore
import datetime
import email.utils
@@ -321,7 +316,7 @@ class RestrictedFieldError(Error):
"""Raised when modifying the raw value of a field is not allowed."""
-class TagSectionWrapper(Mapping):
+class TagSectionWrapper(collections_abc.Mapping):
"""Wrap a TagSection object, using its find_raw method to get field values
This allows us to pick which whitespace to strip off the beginning and end
@@ -423,7 +418,7 @@ class OrderedSet(object):
# ###
-class Deb822Dict(MutableMapping):
+class Deb822Dict(collections_abc.MutableMapping):
"""A dictionary-like object suitable for storing RFC822-like data.
Deb822Dict behaves like a normal dict, except:
diff --git a/lib/debian/debian_support.py b/lib/debian/debian_support.py
index 851eb90..cf4a26e 100644
--- a/lib/debian/debian_support.py
+++ b/lib/debian/debian_support.py
@@ -379,7 +379,7 @@ class Packa