Title: codecs can use PEP-678 notes instead of wrapping/chaining exceptions · Issue #102406 · python/cpython · GitHub
Open Graph Title: codecs can use PEP-678 notes instead of wrapping/chaining exceptions · Issue #102406 · python/cpython
X Title: codecs can use PEP-678 notes instead of wrapping/chaining exceptions · Issue #102406 · python/cpython
Description: In codecs.c there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the same type with a different message, but bails out if there are any complications that make thi...
Open Graph Description: In codecs.c there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the same type with a different message, but bails out if t...
X Description: In codecs.c there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the same type with a different message, but bails out if t...
Opengraph URL: https://github.com/python/cpython/issues/102406
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"codecs can use PEP-678 notes instead of wrapping/chaining exceptions","articleBody":"[In codecs.c](https://github.com/python/cpython/blob/cb944d0be869dfb1189265467ec8a986176cc104/Python/codecs.c#L397) there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the same type with a different message, but bails out if there are any complications that make this unsafe. The purpose is to add information about the context of the operation that failed, without changing the type of the exception. This can be solved more easily and robustly with PEP-678 exception notes. \r\n\r\n\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102407\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/iritkatriel","@type":"Person","name":"iritkatriel"},"datePublished":"2023-03-03T22:52:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/102406/cpython/issues/102406"}
| 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:0b5983c3-c45b-ba86-42f8-275ddfe7950d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8576:3545E1:334FC7E:42FEC35:696B8A0E |
| html-safe-nonce | 9aa18814e5b9f0e2afb0d4ac7fbc7761cd73d2bb864731f6a2ec6f0a957d17cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTc2OjM1NDVFMTozMzRGQzdFOjQyRkVDMzU6Njk2QjhBMEUiLCJ2aXNpdG9yX2lkIjoiNjQ3NzEzMzMyNjM3NDg5ODE5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b281b071ea8bf2610bc6c2da1c3beb99ef8209feec3ed71016423a7de7cc1c2a |
| hovercard-subject-tag | issue:1609359273 |
| 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/102406/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cfc4c479b2fb68d9351e02fdff285881d41e59dc29966a55ebbfe26e1ea61823/python/cpython/issues/102406 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cfc4c479b2fb68d9351e02fdff285881d41e59dc29966a55ebbfe26e1ea61823/python/cpython/issues/102406 |
| og:image:alt | In codecs.c there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the same type with a different message, but bails out if t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iritkatriel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width