FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

curses complexchar.attr carries the color pair and saturates at 255 · Issue #154840 · python/cpython · GitHub

Repository navigation

curses complexchar.attr carries the color pair and saturates at 255 #154840

Closed

Description

Bug description:

The docs say complexchar stores the color pair separately and without the color_pair() limit, but on a wide build attr carries the packed pair and saturates at 255:

>>> curses.complexchar("A", curses.A_BOLD, 1).attr == curses.A_BOLD
False
>>> hex(curses.complexchar("A", 0, 300).attr), curses.complexchar("A", 0, 300).pair
('0xff00', 300)
>>> hex(curses.complexchar("A", 0, 1000).attr)

curses_cell_attr_pair() returns getcchar()'s attrs, which include A_COLOR. Its narrow branch already masks that out, as GH-154703 did for inch().

complexchar is new in 3.16, so no released version is affected.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Jul 29, 2026
  2. added
    3.16new features, bugs and security fixes
    on Jul 29, 2026
  3. added a commit that references this issue on Aug 11, 2026
  4. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL