From: Matthieu Longo <matthieu.longo@arm.com>
To: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>,
Andrew Burgess <aburgess@redhat.com>
Subject: Re: [PATCH v1] py-gdb-readline: replace deprecated interfaces in GdbRemoveReadlineFinder
Date: Tue, 13 Jan 2026 11:34:33 +0000 [thread overview]
Message-ID: <5eaff21b-08a7-4e3e-a9dd-6049a2a29366@arm.com> (raw)
In-Reply-To: <20260107161854.1712307-1-matthieu.longo@arm.com>
On 07/01/2026 16:18, Matthieu Longo wrote:
> A previous patch [1] enabled readline in Python in a GDB-specific way
> and blocked the standard Python readline module to prevent conflicts
> with GDB by adding a custom importer raising an exception for the readline
> module.
>
> This custom importer was written back in 2012 for old Python versions,
> and does not seem to work anymore with Python 3.x. find_module() and
> load_module() have been deprecated since Python 3.4, and the first one
> has been removed since 3.12, and the second will be removed in 3.15.
> The GDB testsuite does not cover this use case, and the removal of
> find_module() was not detected by the testsuite. This issue is tracked
> in bug 32473.
>
> importlib.abc.MetaPathFinder:
> find_module(fullname, path)
> Deprecated since version 3.4: Use find_spec() instead.
> Changed in version 3.10: Use of find_module() by the import
> system now raises ImportWarning.
> Changed in version 3.12: find_module() has been removed. Use
> find_spec() instead.
>
> find_spec(fullname, path, target=None)
> New in version 3.4, as a replacement for find_module.
>
> importlib.abc.Loader:
> load_module(fullname):
> Deprecated since version 3.4, will be removed in version 3.15
> The recommended API for loading a module is exec_module()
> (and create_module()).
>
> This patch uses Patryk Sondej's approach detailed in bug 32473, but with
> a slight variation regarding the finder insertion in sys.meta_path.
> It also adds a new test to prevent future regression.
>
> [1]: 037bbc8eeaf8e6f3a5e185e78268aa71a1159ae7
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32473
Any thoughts ?
Is it the right approach ?
Matthieu
next prev parent reply other threads:[~2026-01-13 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 16:18 Matthieu Longo
2026-01-13 11:34 ` Matthieu Longo [this message]
2026-01-13 16:25 ` Tom Tromey
2026-08-05 13:17 ` Tom de Vries
2026-08-05 15:00 ` Tom de Vries
2026-01-13 16:27 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5eaff21b-08a7-4e3e-a9dd-6049a2a29366@arm.com \
--to=matthieu.longo@arm.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox