summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-12-18 05:35:05 (GMT)
committerGitHub <noreply@github.com>2024-12-18 05:35:05 (GMT)
commit559b0e7013f9cbf42a12fe9c86048d5cbb2f6f22 (patch)
tree7e42cf5aac47abe806215de69ae86b68dfca705c /Lib/idlelib
parentb92f101d0f19a1df32050b8502cfcce777b079b2 (diff)
downloadcpython-559b0e7013f9cbf42a12fe9c86048d5cbb2f6f22.zip
cpython-559b0e7013f9cbf42a12fe9c86048d5cbb2f6f22.tar.gz
cpython-559b0e7013f9cbf42a12fe9c86048d5cbb2f6f22.tar.bz2
gh-127060: Disable traceback colors in IDLE (#128028)
Set TERM environment variable to "dumb" to disable traceback colors in IDLE, since IDLE doesn't understand ANSI escape sequences.
Diffstat (limited to 'Lib/idlelib')
-rwxr-xr-xLib/idlelib/pyshell.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index e882c6c..66fbbd4 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -424,7 +424,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
def spawn_subprocess(self):
if self.subprocess_arglist is None:
self.subprocess_arglist = self.build_subprocess_arglist()
- self.rpcsubproc = subprocess.Popen(self.subprocess_arglist)
+ # gh-127060: Disable traceback colors
+ env = dict(os.environ, TERM='dumb')
+ self.rpcsubproc = subprocess.Popen(self.subprocess_arglist, env=env)
def build_subprocess_arglist(self):
assert (self.port!=0), (