From a45f1b4d26e3324c04e0fe3c3bdf3c9fa6b2219d Mon Sep 17 00:00:00 2001 From: bswck Date: Sat, 18 Oct 2025 13:10:25 +0200 Subject: [PATCH 1/3] Ignore startup file in `test_dumb_terminal_exits_cleanly` --- Lib/test/test_pyrepl/test_pyrepl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index ad7464dc3d37c6..87cd4b4217fbc6 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1406,6 +1406,7 @@ class TestDumbTerminal(ReplTestCase): def test_dumb_terminal_exits_cleanly(self): env = os.environ.copy() env.pop('PYTHON_BASIC_REPL', None) + env.pop('PYTHONSTARTUP', None) env.update({"TERM": "dumb"}) output, exit_code = self.run_repl("exit()\n", env=env) self.assertEqual(exit_code, 0) From 5cc8e1dc44e121349da58cd3e78785b9b8fdee26 Mon Sep 17 00:00:00 2001 From: bswck Date: Thu, 23 Oct 2025 02:46:36 +0200 Subject: [PATCH 2/3] Add a comment --- Lib/test/test_pyrepl/test_pyrepl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 87cd4b4217fbc6..b649ed132f0afb 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1406,6 +1406,8 @@ class TestDumbTerminal(ReplTestCase): def test_dumb_terminal_exits_cleanly(self): env = os.environ.copy() env.pop('PYTHON_BASIC_REPL', None) + # Ignore PYTHONSTARTUP to not pollute the output + # with an unrelated traceback. See #137568 env.pop('PYTHONSTARTUP', None) env.update({"TERM": "dumb"}) output, exit_code = self.run_repl("exit()\n", env=env) From 0db48e54565e48285b5bc64b9934538fe8dbbeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Fri, 24 Oct 2025 23:42:32 +0200 Subject: [PATCH 3/3] Disambiguate issue reference Co-authored-by: Peter Bierma --- Lib/test/test_pyrepl/test_pyrepl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index b649ed132f0afb..e298b2add52c3e 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1407,7 +1407,7 @@ def test_dumb_terminal_exits_cleanly(self): env = os.environ.copy() env.pop('PYTHON_BASIC_REPL', None) # Ignore PYTHONSTARTUP to not pollute the output - # with an unrelated traceback. See #137568 + # with an unrelated traceback. See GH-137568. env.pop('PYTHONSTARTUP', None) env.update({"TERM": "dumb"}) output, exit_code = self.run_repl("exit()\n", env=env)