Skip to content

curses.ERR is 18446744073709551615 instead of -1 #156348

Description

@serhiy-storchaka

Bug report

curses.ERR is set with an unsigned conversion, so it is no longer -1:

>>> import curses
>>> curses.ERR
18446744073709551615

It is -1 in 3.15 and earlier. Code that compares the result of window.getch(), which returns -1 when there is no input, with curses.ERR silently stops matching.

The unsigned conversion is needed for the chtype constants, which can set bits beyond a 32-bit long, but ERR is the only signed constant set that way.

Regression in gh-154934, not yet released.

Linked PRs

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions