[3.13] gh-127060: Disable traceback colors in IDLE (GH-128028) (#128052)

Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.

(cherry picked from commit 559b0e7013)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2024-12-18 06:58:57 +01:00 committed by GitHub
parent fe08cdf265
commit f8b4e20137
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), (