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
diff --git a/debian/changelog b/debian/changelog
index 76f49b0..ef246a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1lazr.restfulclient (0.14.5-1ubuntu1) noble; urgency=medium
2
3 * d/p/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch: replaced
4 readfp (removed in Python 3.12) with read_file when it's available.
5 (LP: #2045169)
6
7 -- Mateus Rodrigues de Morais <mateus.morais@canonical.com> Thu, 07 Dec 2023 10:33:48 -0300
8
1lazr.restfulclient (0.14.5-1) unstable; urgency=medium9lazr.restfulclient (0.14.5-1) unstable; urgency=medium
210
3 [ Stefano Rivera ]11 [ Stefano Rivera ]
diff --git a/debian/control b/debian/control
index b980521..a6e4bf7 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: lazr.restfulclient1Source: lazr.restfulclient
2Section: python2Section: python
3Priority: optional3Priority: optional
4Maintainer: Stefano Rivera <stefanor@debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Stefano Rivera <stefanor@debian.org>
5Uploaders: Debian Python Team <team+python@tracker.debian.org>6Uploaders: Debian Python Team <team+python@tracker.debian.org>
6Build-Depends:7Build-Depends:
7 debhelper-compat (= 13),8 debhelper-compat (= 13),
diff --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
8new file mode 1006449new file mode 100644
index 0000000..b2fa7ce
--- /dev/null
+++ b/debian/patches/0001-ConfigParser.readfp-was-removed-in-Python-3.12.patch
@@ -0,0 +1,25 @@
1From: Mateus Rodrigues de Morais <mateus.morais@canonical.com>
2Date: Wed, 29 Nov 2023 15:32:45 -0300
3Subject: ConfigParser.readfp was removed in Python 3.12. This replaces it
4 with read_file when it is available.
5
6---
7 src/lazr/restfulclient/authorize/oauth.py | 5 ++++-
8 1 file changed, 4 insertions(+), 1 deletion(-)
9
10diff --git a/src/lazr/restfulclient/authorize/oauth.py b/src/lazr/restfulclient/authorize/oauth.py
11index 09abf0b..c8dfc6b 100644
12--- a/src/lazr/restfulclient/authorize/oauth.py
13+++ b/src/lazr/restfulclient/authorize/oauth.py
14@@ -191,7 +191,10 @@ class OAuthAuthorizer(HttpAuthorizer):
15 """
16 # Attempt to load the access token from the file.
17 parser = SafeConfigParser()
18- reader = getattr(parser, "read_file", parser.readfp)
19+ if hasattr(parser, "read_file"):
20+ reader = parser.read_file
21+ else:
22+ reader = parser.readfp
23 reader(readable_file)
24 # Check the version number and extract the access token and
25 # secret. Then convert these to the appropriate instances.
diff --git a/debian/patches/series b/debian/patches/series
0new file mode 10064426new file mode 100644
index 0000000..094a092
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
10001-ConfigParser.readfp-was-removed-in-Python-3.12.patch

Subscribers

People subscribed via source and target branches