Title: Improve error messages of `curses` by indicating failed C function · Issue #125843 · python/cpython · GitHub
Open Graph Title: Improve error messages of `curses` by indicating failed C function · Issue #125843 · python/cpython
X Title: Improve error messages of `curses` by indicating failed C function · Issue #125843 · python/cpython
Description: Feature or enhancement Proposal: The curses module raises an exception curses.error with a message of the form "XXX() returned ERR" where XXX is generally the name of the C or Python function that was just called. Most of the time, XXX a...
Open Graph Description: Feature or enhancement Proposal: The curses module raises an exception curses.error with a message of the form "XXX() returned ERR" where XXX is generally the name of the C or Python function that ...
X Description: Feature or enhancement Proposal: The curses module raises an exception curses.error with a message of the form "XXX() returned ERR" where XXX is generally the name of the C or Python func...
Opengraph URL: https://github.com/python/cpython/issues/125843
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve error messages of `curses` by indicating failed C function","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nThe `curses` module raises an exception `curses.error` with a message of the form \"XXX() returned ERR\" where XXX is generally the name of the C *or* Python function that was just called. Most of the time, XXX and the Python function that was called have the same name and XXX is a real curses C function or macro. However, in some cases, this is not the case and the actual curses function that was called has a different name.\n\nFor debugging purposes, I suggest adding an attribute to the exception class, say `.funcname` which holds the name of the macro / function that was called at runtime in the C code. This will help users debug issues. For compatibility reasons, I will *not* change the current error messages since this could break CI in the wild. In addition, I don't expect users to *extract* the function name from the error message (if they want to, they should use this new attribute).\n\nI considered also adding which *Python* function was the bad one, but since the exception is raised from a Python function, I think it's better not to do include an other attribute. If needed, we can always add it later but for now the curses C function name is more important.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-125844\n* gh-134252\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2024-10-22T14:20:25Z","url":"https://github.com/python/cpython/issues/125843"}
| 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:2ade12a1-4935-b59d-5e0c-2f5254863676 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC62:1FDCFC:12534EE:1833496:6B065835 |
| html-safe-nonce | e4eb4d28349b00987119932ebf75e18b255409a8e040738e7a95d8d0c9d09ac3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzYyOjFGRENGQzoxMjUzNEVFOjE4MzM0OTY6NkIwNjU4MzUiLCJ2aXNpdG9yX2lkIjoiMTE1MTE2MTAyMDc4MjYzMDk2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8f38f321c170fe9678bc769facdfdbf221f3a802f2e746e129b505f3c7962e90 |
| hovercard-subject-tag | issue:2605607739 |
| 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/125843/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aad1a42387556794fe982373057f61615024de4530c3395446273fdfac48d7b7/python/cpython/issues/125843 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aad1a42387556794fe982373057f61615024de4530c3395446273fdfac48d7b7/python/cpython/issues/125843 |
| og:image:alt | Feature or enhancement Proposal: The curses module raises an exception curses.error with a message of the form "XXX() returned ERR" where XXX is generally the name of the C or Python function that ... |
| 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 | 6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297 |
| 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 | 7f0aa75f4141d440c6110dc31af7ea7797abb6c4 |
| 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