Skip to content

Conversation

@freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Feb 20, 2025

#129140 slightly modified the logic associated with determining if a console could be colorised. In doing so, the test became sensitive to the test environment's value for the TERM setting.

The iOS 18.2 test simulator sets TERM=dumb in the test environment - this makes some sense, as stdout/stderr handling is performed by the system log, which won't honor tty control sequences.

This appears to be a recent change to iOS; it wasn't true in iOS 17.2. With the recent update to the iOS buildbot, the problem became apparent.

However, the issue isn't iOS specific - it will occur on any machine where TERM=dumb is set in the testing environment. On macOS, I can reproduce the issue with:

TERM=dumb python3.14 -m test test__colorize 

This PR ensures that TERM is correctly mocked as part of the colorise test, and normalizes the name used by the iOS Testbed to disable terminal colors.

@freakboy3742
Copy link
Contributor Author

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 096c689 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130333%2Fmerge

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thank you!

@freakboy3742
Copy link
Contributor Author

The iOS buildbot is currently failing because of changes introduced in #130007 and #130318 that are unrelated to this change. The build log show this PR as passing the (previously failed) test__colorize.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@freakboy3742 freakboy3742 enabled auto-merge (squash) February 20, 2025 06:21
@freakboy3742 freakboy3742 merged commit 1b07006 into python:main Feb 20, 2025
39 checks passed
@miss-islington-app
Copy link

Thanks @freakboy3742 for the PR 🌮🎉.. 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 Feb 20, 2025
…ythonGH-130333) Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 1b07006) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 20, 2025

GH-130334 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 Feb 20, 2025
@freakboy3742 freakboy3742 deleted the ios-colorize branch February 20, 2025 06:51
freakboy3742 added a commit that referenced this pull request Feb 20, 2025
…H-130333) (#130334) Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) (cherry picked from commit 1b07006) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Mar 16, 2025
…nals. (pythonGH-130333) (python#130334) Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) (cherry picked from commit 1b07006) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Mar 16, 2025
…nals. (pythonGH-130333) (python#130334) Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) (cherry picked from commit 1b07006) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Mar 16, 2025
…als. (pythonGH-130333) (python#130334) Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) (cherry picked from commit 1b07006) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants