Skip to content

Commit e7bb732

Browse files
miss-islingtonjohnslavikvstinner
authored
[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 f564654) Co-authored-by: Bartosz Sławecki <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
1 parent dc12380 commit e7bb732

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/support/pty_helper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ def run_pty(script, input=b"dummy input\r", env=None):
1515
output = bytearray()
1616
[master, slave] = pty.openpty()
1717
args = (sys.executable, '-c', script)
18+
19+
# Isolate readline from personal init files by setting INPUTRC
20+
# to an empty file. See also GH-142353.
21+
if env is None:
22+
env = {**os.environ.copy(), "INPUTRC": os.devnull}
23+
else:
24+
env.setdefault("INPUTRC", os.devnull)
25+
1826
proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave, env=env)
1927
os.close(slave)
2028
with ExitStack() as cleanup:

0 commit comments

Comments
 (0)