From 9af5a49a97bfa660bac83b24bbf2ad48c5b3a649 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Mon, 22 Sep 2025 17:58:12 +0800 Subject: [PATCH 1/2] Fix mismatched traceback in `pythonrc.py` injection --- python_files/pythonrc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 005b06bcdd15..b8c02b7e2e60 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -4,6 +4,10 @@ if sys.platform != "win32": import readline +# Avoid caching this file by linecache and incorrectly report tracebacks. +__spec__ = __loader__ = None + + original_ps1 = ">>> " is_wsl = "microsoft-standard-WSL" in platform.release() From 09923943dc59ddfe891fc9bf3d6e4079ad2575c8 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Wed, 21 Oct 2026 17:27:40 -0700 Subject: [PATCH 2/2] Document CPython traceback fix references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- python_files/pythonrc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 11ada262f5ca..b1ad73b917e6 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -1,5 +1,7 @@ # PYTHONSTARTUP runs in __main__; clear its metadata at module scope so linecache # cannot use this file's loader for later interactive tracebacks. +# CPython issue: https://github.com/python/cpython/issues/129098 +# CPython fix: https://github.com/python/cpython/pull/130721 __spec__ = __loader__ = None