8000 gh-91221: remove unreliable checks on `curses.pair_content(0)` by picnixz · Pull Request #132986 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-91221: remove unreliable checks on curses.pair_content(0) #132986

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

Conversation

picnixz
Copy link
Member
@picnixz picnixz commented Apr 26, 2025

The current terminal fg/bg colors given by pair_content(0), which is backed by extended_pair_content(3), depends on the terminal emulator and its supported colors. Thus, its output cannot not be reliably checked.

The current terminal fg/bg colors given by `pair_content(0)`,
which is backed by `extended_pair_content(3)`, depends on the
terminal emulator and its supported colors. Thus, its output
cannot not be reliably checked.
@bedevere-app bedevere-app bot added awaiting core review tests Tests in the Lib/test dir labels Apr 26, 2025
@picnixz picnixz added needs backport to 3.13 bugs and security fixes and removed tests Tests in the Lib/test dir labels Apr 26, 2025
@picnixz picnixz added the tests Tests in the Lib/test dir label Apr 26, 2025
@picnixz picnixz changed the title gh-132985: remove unreliable checks on curses.pair_content(0) gh-91221: remove unreliable checks on curses.pair_content(0) Apr 26, 2025
@picnixz
Copy link
Member Author
picnixz commented Apr 26, 2025

I'll use #132990. At least we won't bother people. If there are more users that can be annoyed, let's just remove the check later.

@picnixz picnixz closed this Apr 26, 2025
@picnixz picnixz deleted the test/fix/curses-test-use-default-colors-132985 branch April 26, 2025 10:12
Comment on lines +989 to +992
# The current terminal fg/bg colors given by pair_content(0),
# which is backed by extended_pair_content(3), depends on the
# terminal emulator and its supported colors.
curses.pair_content(0)
Copy link
Member

Choose a reason for hiding this comment

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

If we remove the check, the call to curses.pair_content(0) can be removed as well. It is no longer useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

I eventually decided to use the other PR. It's not really an issue and it could catch issues when we call pair_content(0) from the C code.

@@ -0,0 +1,3 @@
Do not check the output of :func:`curses.pair_content(0)
Copy link
Member

Choose a reason for hiding this comment

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

We usually do not add NEWS entries for test-only changes. They are not useful for Python users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review needs backport to 3.13 bugs and security fixes tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0