Skip to content

curses: incorrect and incomplete documentation of the reading functions #156234

Closed

Description

@serhiy-storchaka

The documentation of the curses functions that read input and window contents contains errors and omissions.

Wrong types: window.instr() and window.getstr() are documented as returning a string, and their n as a number of characters, while they return a bytes object and n limits the number of bytes. instr() also mentions a trailing NUL, which a bytes object does not have. window.getkey() returns a str, not a "multibyte string". unctrl() returns a bytes object, not a string.

It is not said whether an integer standing for a character is an encoded byte (as in window.addch() and ungetch()) or a character code (as in unget_wch(), which does not accept a key code).

Omissions with respect to X/Open Curses: special keys are only translated to the KEY_* constants in keypad mode, which is not the default; the window is refreshed before a read; a read can also time out, not only be non-blocking.

Linked PRs

Activity

  1. added a commit that references this issue on Aug 23, 2026
  2. added 2 commits that reference this issue on Aug 23, 2026
  3. added a commit that references this issue on Aug 27, 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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions