[Bug python/32473] GDB import readline
"cvs-commit at gcc dot gnu.org via Gdb-prs" <[email protected]>
| Newsgroups | gmane.comp.gdb.bugs.discuss |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://sourceware.org/bugzilla/show_bug.cgi?id=32473 --- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The gdb-17-branch branch has been updated by Tom de Vries <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a1c1c2e4ce3680e2ee14cbc666d4c6d08b6002f7 commit a1c1c2e4ce3680e2ee14cbc666d4c6d08b6002f7 Author: Matthieu Longo <[email protected]> Date: Wed Aug 5 19:40:28 2026 +0200 py-gdb-readline: replace deprecated interfaces in GdbRemoveReadlineFinder 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 Approved-By: Tom Tromey <[email protected]> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32473 (cherry picked from commit 7cb9d3f07827ccdcf2fb17d9271ab3c4574b2635) -- You are receiving this mail because: You are on the CC list for the bug.