]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-133579: consistently report C curses function failures (#134327)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 27 May 2025 10:15:16 +0000 (12:15 +0200)
committerGitHub <noreply@github.com>
Tue, 27 May 2025 10:15:16 +0000 (10:15 +0000)
commit30dde1eeb3fa1e0e7417f9cdded8fd90766f2559
tree54891a6a7146bf79bdfec4a35d8042c590692e1d
parent604f83550bc4fd5507019969247c12a6a6454ded
gh-133579: consistently report C curses function failures (#134327)

Some curses module-level functions and window methods now raise
a `curses.error` when a call to a C curses function fails:

- Module-level functions: assume_default_colors, baudrate, cbreak,
  echo, longname, initscr, nl, raw, termattrs, termname, and unctrl.
- Window methods: addch, addnstr, addstr, border, box, chgat,
  getbkgd, inch, insstr, and insnstr.

In addition, `curses.window.refresh` and `curses.window.noutrefresh`
now raise a `TypeError` instead of a `curses.error` when called with an
incorrect number of arguments for pads.

See also ee36db550076e5a9185444ffbc53eaf8157ef04c for similar
changes.
Doc/howto/curses.rst
Misc/NEWS.d/next/Library/2025-05-27-11-13-51.gh-issue-133579.KY9M6S.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-05-27-11-18-13.gh-issue-133579.ohtgdC.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-05-27-11-24-38.gh-issue-133579.WGPUC1.rst [new file with mode: 0644]
Modules/_cursesmodule.c
Modules/clinic/_cursesmodule.c.h