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.
This commit is contained in:
Victor Stinner 2024-12-18 06:35:05 +01:00 committed by GitHub
parent b92f101d0f
commit 559b0e7013
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -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), (

View File

@ -0,0 +1,2 @@
Set TERM environment variable to "dumb" to disable traceback colors in IDLE,
since IDLE doesn't understand ANSI escape sequences. Patch by Victor Stinner.