Skip to content

gh-139445: Skip pyrepl tests if the terminal is not supported#154497

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:pyrepl-terminal-skip
Jul 23, 2026
Merged

gh-139445: Skip pyrepl tests if the terminal is not supported#154497
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:pyrepl-terminal-skip

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 22, 2026

Copy link
Copy Markdown
Member

TestMain was only skipped if TERM was unset or dumb, but pyrepl needs the terminal to have the bel, clear, cup and el capabilities. Without them it falls back to the basic REPL, and six tests which type bare exit wait for the timeout.

Checking the capabilities subsumes the unset/dumb case.

They were only skipped if TERM was unset or "dumb", but pyrepl also
needs the terminal to have several capabilities.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 22, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news labels Jul 22, 2026
@edvilme

edvilme commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Is the use of _colorize.get_colors relevant here?

def get_colors(

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Yes, can_colorize() has the same TERM=dumb-only check. But there it is probably harmless: ANSI colors work even on terminals like TERM=su that lack the cursor-movement capabilities (cup etc.) pyrepl needs.

@serhiy-storchaka
serhiy-storchaka merged commit 7745710 into python:main Jul 23, 2026
61 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the pyrepl-terminal-skip branch July 23, 2026 07:44
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7745710bec7f6de899e97d6f87528035e8977d85 3.14

@bedevere-app

bedevere-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

GH-154530 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 23, 2026
@bedevere-app

bedevere-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

GH-154529 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 23, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 23, 2026
…H-154497) (GH-154530)

They were only skipped if TERM was unset or "dumb", but pyrepl also
needs the terminal to have several capabilities.

(cherry picked from commit 7745710)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable LTO + PGO 3.x (tier-3) has failed when building commit 7745710.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1627/builds/3093) and take a look at the build logs.
  4. Check if the failure is related to this commit (7745710) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1627/builds/3093

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to '7745710bec7f6de899e97d6f87528035e8977d85'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 7745710bec7f6 gh-139445: Skip pyrepl tests if the terminal is not supported (GH-154497)
Switched to and reset branch 'main'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3474: clean-retain-profile] Error 1 (ignored)
./Modules/socketmodule.c: In function ‘getsockaddrarg’:
./Modules/socketmodule.c:2646:9: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
 2646 |         strncpy((char *)sa->salg_name, name, sizeof(sa->salg_name));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar: unable to copy file 'libpython3.16.a'; reason: No space left on device
make[2]: *** [Makefile:1163: libpython3.16.a] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:996: profile-gen-stamp] Error 2
make: *** [Makefile:1008: profile-run-stamp] Error 2

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable LTO 3.x (tier-3) has failed when building commit 7745710.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1654/builds/3070) and take a look at the build logs.
  4. Check if the failure is related to this commit (7745710) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1654/builds/3070

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to '7745710bec7f6de899e97d6f87528035e8977d85'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 7745710bec7f6 gh-139445: Skip pyrepl tests if the terminal is not supported (GH-154497)
Switched to and reset branch 'main'

ar: unable to copy file 'libpython3.16.a'; reason: No space left on device
make: *** [Makefile:1163: libpython3.16.a] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants