Skip to content

gh-154840: Keep the color pair out of curses complexchar.attr - #154841

Open
fedonman wants to merge 1 commit into
python:mainfrom
fedonman:curses-complexchar-attr-color
Open

gh-154840: Keep the color pair out of curses complexchar.attr#154841
fedonman wants to merge 1 commit into
python:mainfrom
fedonman:curses-complexchar-attr-color

Conversation

@fedonman

@fedonman fedonman commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

complexchar.attr carried the packed color pair on a wide build and saturated at 255,
although the docs say the pair is stored separately and is not limited to a color_pair()
value. Mask A_COLOR in the wide branch of curses_cell_attr_pair(), which its narrow
branch already does. repr() reads through the same function and is fixed with it.

The test fails without the change. New in 3.16, so no NEWS entry.

On a wide build getcchar() reports the packed color pair in the attributes,
so attr carried it and saturated at 255, although the documentation says the
pair is stored separately and is not limited to a color_pair() value. Mask
A_COLOR out, as the narrow branch of the same function already does. repr()
reads through the same function and is fixed with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant