Title: Exact reporting of `curses` C function failures · Issue #133579 · python/cpython · GitHub
Open Graph Title: Exact reporting of `curses` C function failures · Issue #133579 · python/cpython
X Title: Exact reporting of `curses` C function failures · Issue #133579 · python/cpython
Description: When calling some curses C functions, we ignore their return values. Those are: in PyCursesWindow_dealloc, we ignore delwin() errors in _curses_initscr_impl, we ignore wrefresh() errors in _curses_window_addstr_impl, we ignore wattrset()...
Open Graph Description: When calling some curses C functions, we ignore their return values. Those are: in PyCursesWindow_dealloc, we ignore delwin() errors in _curses_initscr_impl, we ignore wrefresh() errors in _curses_...
X Description: When calling some curses C functions, we ignore their return values. Those are: in PyCursesWindow_dealloc, we ignore delwin() errors in _curses_initscr_impl, we ignore wrefresh() errors in _curses_...
Opengraph URL: https://github.com/python/cpython/issues/133579
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exact reporting of `curses` C function failures","articleBody":"When calling some curses C functions, we ignore their return values. Those are:\n\n- in `PyCursesWindow_dealloc`, we ignore `delwin()` errors\n- in `_curses_initscr_impl`, we ignore `wrefresh()` errors\n- in `_curses_window_addstr_impl`, we ignore `wattrset()` errors and prefer reporting errors due to adding strings. Same for the `insstr*` functions\n- in `_curses_window_box_impl`, we ignore the error returned by `box()`. This is correct because the manual says (for `box`):\n \n > All routines return the integer OK. The SVr4.0 manual says \"or a non-negative integer if immedok is set\", but this appears to be an error. X/Open does not define any error conditions. This implementation returns an error if the window pointer is null.\n\n In this case, I think it's better to explicitly suppress the return value and link the manpage.\n\nThe question now is:\n\n- What should we do for a failing `delwin()` in the destructor?\n- What should we do for `wattrset()` when this routine is not the \"important\" one?\n\ncc @encukou \n\n---\n\n> [!NOTE]\n> We will not backport these fixes as they could break existing code that could be surprised by a new exception. \n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-134327\n* gh-134629\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2025-05-07T12:44:41Z","url":"https://github.com/python/cpython/issues/133579"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fb8a1b32-9055-3aa2-05cd-04bfe0d619c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC8A:1E1784:F03262:1407025:6B064E0B |
| html-safe-nonce | 2becf0b900906f2af9038ba3f1bc23cef50d3a455956c87147b5ae23e15ddef4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzhBOjFFMTc4NDpGMDMyNjI6MTQwNzAyNTo2QjA2NEUwQiIsInZpc2l0b3JfaWQiOiIyMzQxMzQ4NzE5NjY2Mjg2MDkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 48ef6df2227d92a6ee96407376956226117cdd7a4520272b9480dad7b30cde3f |
| hovercard-subject-tag | issue:3045847256 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/133579/issue_layout |
| twitter:image | https://opengraph.githubassets.com/418f05515689029bf4873e43de2acf9f59ebbbb5f4f6c4ffd45262fca051b6af/python/cpython/issues/133579 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/418f05515689029bf4873e43de2acf9f59ebbbb5f4f6c4ffd45262fca051b6af/python/cpython/issues/133579 |
| og:image:alt | When calling some curses C functions, we ignore their return values. Those are: in PyCursesWindow_dealloc, we ignore delwin() errors in _curses_initscr_impl, we ignore wrefresh() errors in _curses_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | picnixz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f1f9a08f7c769a37f1dfc18ad43d463c222a7eea |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width