From e4444538dcd60a1b655c620b4d3bba59a7830f25 Mon Sep 17 00:00:00 2001 From: Vineet Kumar <108144301+whyvineet@users.noreply.github.com> Date: Wed, 6 May 2026 07:55:08 +0530 Subject: [PATCH 1/3] gh-149096: Remove 'im_*' attribute reference from inspect module docstring (#149108) The im_class/func/self names were removed in 3.0. The prefix appears nowhere else in inspect.py and nowhere in inspect.rst. --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index 9eb87b0d277918..b1bbdd4c365e3d 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1,7 +1,7 @@ """Get useful information from live Python objects. This module encapsulates the interface provided by the internal special -attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. +attributes (co_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module: From 2140b14a9bbc6a2a6564e67425cab10854a26bf1 Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Tue, 5 May 2026 22:48:00 -0500 Subject: [PATCH 2/3] gh-124111: Fix tclWin32Exe value in tcltk.props for Tcl 9 (GH-149441) --- PCbuild/tcltk.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props index d26b36ba98e493..55f98be1eb7eeb 100644 --- a/PCbuild/tcltk.props +++ b/PCbuild/tcltk.props @@ -15,13 +15,13 @@ $(ExternalsDir)tcl-core-$(TclVersion)\ $(ExternalsDir)tk-$(TkVersion)\ $(ExternalsDir)tcltk-$(TclVersion)\$(ArchName)\ - $(tcltkDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe - $(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe + t + tcl9 + $(tcltkDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix).exe + $(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix).exe TCL_WITH_EXTERNAL_TOMMATH; - t - tcl9 tcl$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix)$(TclDebugExt).dll tcl$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix)$(TclDebugExt).lib tclsh$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix)$(TclDebugExt).exe From 970b0433f498fd0d048b1f50229a7f0fb4d9e07a Mon Sep 17 00:00:00 2001 From: Shrey Naithani Date: Wed, 6 May 2026 09:52:58 +0530 Subject: [PATCH 3/3] gh-148615: Handle `--` separator in pdb argument parsing (#148624) --- Lib/pdb.py | 4 ++++ Lib/test/test_pdb.py | 21 +++++++++++++++++++ ...-04-15-16-08-12.gh-issue-148615.Uvx50R.rst | 1 + 3 files changed, 26 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-04-15-16-08-12.gh-issue-148615.Uvx50R.rst diff --git a/Lib/pdb.py b/Lib/pdb.py index f2a653cf53c748..01451f0229cacb 100644 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -3809,6 +3809,10 @@ def parse_args(): opt_module = parser.parse_args(args[:2]) opts.module = opt_module.module args = args[2:] + elif args[0] == '--': + args.pop(0) + if not args: + parser.error("missing script or module to run") elif args[0].startswith('-'): # Invalid argument before the script name. invalid_args = list(itertools.takewhile(lambda a: a.startswith('-'), args)) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 8b6ccfbf051e6e..410f1436ed4d20 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -4718,6 +4718,27 @@ def bar(): ])) self.assertIn('break in bar', stdout) + def test_end_of_options_separator(self): + # gh-148615: Test parsing when '--' separator is used + script = "import sys; print(f'ARGS: {sys.argv[1:]}')" + with open(os_helper.TESTFN, 'w', encoding='utf-8') as f: + f.write(script) + stdout, _ = self._run_pdb(['--', os_helper.TESTFN, '-foo'], 'c\nq') + self.assertIn("ARGS: ['-foo']", stdout) + stdout, _ = self._run_pdb(['-c', 'continue', '--', os_helper.TESTFN, '-c', 'foo'], 'q') + self.assertIn("ARGS: ['-c', 'foo']", stdout) + stdout, stderr = self._run_pdb(['--'], 'q', expected_returncode=2) + self.assertIn("missing script or module to run", stderr) + stdout, stderr = self._run_pdb(['-x', '--', os_helper.TESTFN], 'q', expected_returncode=2) + self.assertIn("unrecognized arguments: -x", stderr) + stdout, _ = self._run_pdb([os_helper.TESTFN, '--', 'arg'], 'c\nq') + self.assertIn("ARGS: ['--', 'arg']", stdout) + with os_helper.temp_cwd(): + with open('mymod.py', 'w', encoding='utf-8') as f: + f.write(script) + stdout, _ = self._run_pdb(['-m', 'mymod', '--', 'arg'], 'c\nq') + self.assertIn("ARGS: ['--', 'arg']", stdout) + @unittest.skipIf(SKIP_CORO_TESTS, "Coroutine tests are skipped") def test_async_break(self): script = """ diff --git a/Misc/NEWS.d/next/Library/2026-04-15-16-08-12.gh-issue-148615.Uvx50R.rst b/Misc/NEWS.d/next/Library/2026-04-15-16-08-12.gh-issue-148615.Uvx50R.rst new file mode 100644 index 00000000000000..f023f0141889a6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-04-15-16-08-12.gh-issue-148615.Uvx50R.rst @@ -0,0 +1 @@ +Fix :mod:`pdb` to accept standard -- end of options separator. Reported by haampie. Patched by Shrey Naithani.