Merge ~mateus-morais/ubuntu/+source/lazr.restfulclient:launchpadlib-proposed-migration into ubuntu/+source/lazr.restfulclient:ubuntu/devel

Proposed by Mateus Rodrigues de Morais
Status: Work in progress
Proposed branch: ~mateus-morais/ubuntu/+source/lazr.restfulclient:launchpadlib-proposed-migration
Merge into: ubuntu/+source/lazr.restfulclient:ubuntu/devel
Diff against target: 68 lines (+36/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch (+25/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Review via email: mp+456553@code.launchpad.net

Description of the change

This Merge Proposal replaces ConfigParser.readfp (deprecated and removed from Python 3.12) with ConfigParser.read_file when the latter is available.

This will remove the block from python-launchpadlib on the migration of package python3-defaults, which adds support for Python 3.12. The library python-launchpadlib depends on lazr.restfulclient and, as it is currently, it contains a regression due to this Python breaking change.

PPA: https://launchpad.net/~mateus-morais/+archive/ubuntu/lazr.restfulclient-ppa-test

To post a comment you must log in.
Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote (last edit ):
a45f89b... by Mateus Rodrigues de Morais

  * d/p/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch: replaced
    readfp (removed in Python 3.12) with read_file. (LP: #2045169)

638900e... by Mateus Rodrigues de Morais

update-maintainer

89d439d... by Mateus Rodrigues de Morais

changelog

Unmerged commits

89d439d... by Mateus Rodrigues de Morais

changelog

638900e... by Mateus Rodrigues de Morais

update-maintainer

a45f89b... by Mateus Rodrigues de Morais

  * d/p/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch: replaced
    readfp (removed in Python 3.12) with read_file. (LP: #2045169)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 76f49b0..ef246a2 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+lazr.restfulclient (0.14.5-1ubuntu1) noble; urgency=medium
7+
8+ * d/p/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch: replaced
9+ readfp (removed in Python 3.12) with read_file when it's available.
10+ (LP: #2045169)
11+
12+ -- Mateus Rodrigues de Morais <mateus.morais@canonical.com> Thu, 07 Dec 2023 10:33:48 -0300
13+
14 lazr.restfulclient (0.14.5-1) unstable; urgency=medium
15
16 [ Stefano Rivera ]
17diff --git a/debian/control b/debian/control
18index b980521..a6e4bf7 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: lazr.restfulclient
23 Section: python
24 Priority: optional
25-Maintainer: Stefano Rivera <stefanor@debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Stefano Rivera <stefanor@debian.org>
28 Uploaders: Debian Python Team <team+python@tracker.debian.org>
29 Build-Depends:
30 debhelper-compat (= 13),
31diff --git a/debian/patches/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch b/debian/patches/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch
32new file mode 100644
33index 0000000..b2fa7ce
34--- /dev/null
35+++ b/debian/patches/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch
36@@ -0,0 +1,25 @@
37+From: Mateus Rodrigues de Morais <mateus.morais@canonical.com>
38+Date: Wed, 29 Nov 2023 15:32:45 -0300
39+Subject: ConfigParser.readfp was removed in Python 3.12. This replaces it
40+ with read_file when it is available.
41+
42+---
43+ src/lazr/restfulclient/authorize/oauth.py | 5 ++++-
44+ 1 file changed, 4 insertions(+), 1 deletion(-)
45+
46+diff --git a/src/lazr/restfulclient/authorize/oauth.py b/src/lazr/restfulclient/authorize/oauth.py
47+index 09abf0b..c8dfc6b 100644
48+--- a/src/lazr/restfulclient/authorize/oauth.py
49++++ b/src/lazr/restfulclient/authorize/oauth.py
50+@@ -191,7 +191,10 @@ class OAuthAuthorizer(HttpAuthorizer):
51+ """
52+ # Attempt to load the access token from the file.
53+ parser = SafeConfigParser()
54+- reader = getattr(parser, "read_file", parser.readfp)
55++ if hasattr(parser, "read_file"):
56++ reader = parser.read_file
57++ else:
58++ reader = parser.readfp
59+ reader(readable_file)
60+ # Check the version number and extract the access token and
61+ # secret. Then convert these to the appropriate instances.
62diff --git a/debian/patches/series b/debian/patches/series
63new file mode 100644
64index 0000000..094a092
65--- /dev/null
66+++ b/debian/patches/series
67@@ -0,0 +1 @@
68+0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch

Subscribers

People subscribed via source and target branches