https://github.com/python/cpython/commit/e7bb732d8b06524722e5a1b0f7ea4e8e03ecdae8
commit: e7bb732d8b06524722e5a1b0f7ea4e8e03ecdae8
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2025-12-13T10:58:43Z
summary:

[3.13] gh-142353: Isolate tests from personal GNU Readline init files 
(GH-142370) (#142635)

gh-142353: Isolate tests from personal GNU Readline init files (GH-142370)

Isolate tests from personal Readline init files using `INPUTRC=/dev/null` trick.
(cherry picked from commit f564654bae79c69e3de40dadbec2399f1423ffcf)

Co-authored-by: Bartosz SÅ‚awecki <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/test/support/pty_helper.py

diff --git a/Lib/test/support/pty_helper.py b/Lib/test/support/pty_helper.py
index 6587fd40333c51..dbe7fa429096fc 100644
--- a/Lib/test/support/pty_helper.py
+++ b/Lib/test/support/pty_helper.py
@@ -15,6 +15,14 @@ def run_pty(script, input=b"dummy input\r", env=None):
     output = bytearray()
     [master, slave] = pty.openpty()
     args = (sys.executable, '-c', script)
+
+    # Isolate readline from personal init files by setting INPUTRC
+    # to an empty file. See also GH-142353.
+    if env is None:
+        env = {**os.environ.copy(), "INPUTRC": os.devnull}
+    else:
+        env.setdefault("INPUTRC", os.devnull)
+
     proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave, 
env=env)
     os.close(slave)
     with ExitStack() as cleanup:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to