summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_repl.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-09-06 14:23:47 (GMT)
committerGitHub <noreply@github.com>2024-09-06 14:23:47 (GMT)
commit2cc1899b938cb9ced5dec47070fb263fcb2d90d0 (patch)
tree6a7cad7e12cb2d90f957bf0a62336629515f7f69 /Lib/test/test_repl.py
parentc46ad20d41a95d0c621d9aa79e829fad9654b381 (diff)
downloadcpython-2cc1899b938cb9ced5dec47070fb263fcb2d90d0.zip
cpython-2cc1899b938cb9ced5dec47070fb263fcb2d90d0.tar.gz
cpython-2cc1899b938cb9ced5dec47070fb263fcb2d90d0.tar.bz2
[3.13] gh-119310: Fix encoding when reading old history file (GH-121779) (#123784)
(cherry picked from commit e95984826eb3cdb3a3baedb2ccea35e11e9f8161) Co-authored-by: aorcajo <589252+aorcajo@users.noreply.github.com> Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_repl.py')
-rw-r--r--Lib/test/test_repl.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_repl.py b/Lib/test/test_repl.py
index 363808c..cd8ef0f 100644
--- a/Lib/test/test_repl.py
+++ b/Lib/test/test_repl.py
@@ -41,7 +41,7 @@ def spawn_repl(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
# path may be used by Py_GetPath() to build the default module search
# path.
stdin_fname = os.path.join(os.path.dirname(sys.executable), "<stdin>")
- cmd_line = [stdin_fname, '-E', '-i']
+ cmd_line = [stdin_fname, '-I', '-i']
cmd_line.extend(args)
# Set TERM=vt100, for the rationale see the comments in spawn_python() of
@@ -228,6 +228,7 @@ class TestInteractiveInterpreter(unittest.TestCase):
f.write("exit(0)" + os.linesep)
env = os.environ.copy()
+ env["PYTHON_HISTORY"] = os.path.join(tmpdir, ".asyncio_history")
env["PYTHONSTARTUP"] = script
subprocess.check_call(
[sys.executable, "-m", "asyncio"],
@@ -240,7 +241,7 @@ class TestInteractiveInterpreter(unittest.TestCase):
@unittest.skipUnless(pty, "requires pty")
def test_asyncio_repl_is_ok(self):
m, s = pty.openpty()
- cmd = [sys.executable, "-m", "asyncio"]
+ cmd = [sys.executable, "-I", "-m", "asyncio"]
proc = subprocess.Popen(
cmd,
stdin=s,