Skip to content

gh-127060: Disable traceback colors in IDLE #128028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 17, 2024

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.
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@vstinner
Copy link
Member Author

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

Copy link
Member

@terryjreedy terryjreedy left a comment

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
38 checks passed
@miss-islington-app
Copy link

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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 18, 2024

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 <[email protected]>
@vstinner vstinner deleted the idle_dumb_term branch December 18, 2024 08:07
@vstinner
Copy link
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