Skip to content

gh-127060: Disable traceback colors in IDLE#128028

Merged
terryjreedy merged 3 commits into
python:mainfrom
vstinner:idle_dumb_term
Dec 18, 2024
Merged

gh-127060: Disable traceback colors in IDLE#128028
terryjreedy merged 3 commits into
python:mainfrom
vstinner:idle_dumb_term

Conversation

@vstinner

@vstinner vstinner commented Dec 17, 2024

Copy link
Copy Markdown
Member

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

Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.
Comment thread Lib/idlelib/pyshell.py Outdated

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vstinner

Copy link
Copy Markdown
Member Author

@terryjreedy: Are you ok with this approach for now?

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on macOS and colors were suppressed even when excepthook was set. I would have been OK with setting in IDLE processes, but being explicit here is fine too.

I believe sys.subprocess_arglist and sys.env could be set in init but will defer this and other cleanups to another PR sometime.

Tests were hanging incomplete, so updated to trigger a proper run. Will merge if finish before sleep.

@terryjreedy terryjreedy merged commit 559b0e7 into python:main Dec 18, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 18, 2024
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.
(cherry picked from commit 559b0e7)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app

bedevere-app Bot commented Dec 18, 2024

Copy link
Copy Markdown

GH-128052 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Dec 18, 2024
terryjreedy pushed a commit that referenced this pull request Dec 18, 2024
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.

(cherry picked from commit 559b0e7)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner vstinner deleted the idle_dumb_term branch December 18, 2024 08:07
@vstinner

Copy link
Copy Markdown
Member Author

Thanks for the review and the merge.

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants