Title: fix: remove redundant error handling in unpacking functions by methane · Pull Request #2 · methane/msgpack-python · GitHub
Open Graph Title: fix: remove redundant error handling in unpacking functions by methane · Pull Request #2 · methane/msgpack-python
X Title: fix: remove redundant error handling in unpacking functions by methane · Pull Request #2 · methane/msgpack-python
Description: NoteMedium Risk Changes core msgpack unpack control flow and exception propagation for all unpackb and streaming unpack paths; behavior should match for normal errors but edge cases around C/Python exception interaction deserve regression testing. Overview Unpack error handling is simplified so Python exceptions raised inside the C unpack path propagate through Cython instead of being double-handled in Python. The execute_fn pointer is declared with except -1 (replacing except? -1), and the redundant PyErr_Occurred() / bare raise branches are removed from unpackb and Unpacker._unpack. Callback failures and explicit PyErr_* calls in the unpack template still surface as normal Python exceptions. Internal unpack setup no longer uses a no-op unpack_callback_root; the root stack slot is initialized with NULL, and dead commented code around an alternate dynamic stack is removed. Invalid internal parser state (unexpected cs or container type) now sets RuntimeError via PyErr_Format before failing, instead of falling through without a clear exception. Reviewed by Cursor Bugbot for commit 38927d1. Bugbot is set up for automated code reviews on this repo. Configure here. Summary by CodeRabbit Bug Fixes Improved unpacking error handling so failures produce clearer, more consistent messages rather than sometimes leaking pending exceptions. Enhanced robustness across both single-value and streaming unpacking by tightening state and stack validation for malformed or unsupported input. Strengthened internal checks to reliably fail when the unpacking state encounters unexpected conditions, improving predictability for invalid data.
Open Graph Description: NoteMedium Risk Changes core msgpack unpack control flow and exception propagation for all unpackb and streaming unpack paths; behavior should match for normal errors but edge cases around C/Python...
X Description: NoteMedium Risk Changes core msgpack unpack control flow and exception propagation for all unpackb and streaming unpack paths; behavior should match for normal errors but edge cases around C/Python...
Opengraph URL: https://github.com/methane/msgpack-python/pull/2
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ea4f228f-75d0-e2eb-bfc7-f42e993efe6a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A162:25305:1CFED:2B100:6A4E22C7 |
| html-safe-nonce | 89c87c2819dffd57e0ccdee5e61979adb2c5e3ef7125787f650bd1dbb56fa0e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTYyOjI1MzA1OjFDRkVEOjJCMTAwOjZBNEUyMkM3IiwidmlzaXRvcl9pZCI6IjM1ODUwODc0MTA4MTQxOTg0NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 18df6b8c331017b6f44014b34d0529a6a6ccbf6dbdf580ff512685e3405bf7fe |
| hovercard-subject-tag | pull_request:3925423390 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/methane/msgpack-python/pull/2/files |
| twitter:image | https://avatars.githubusercontent.com/u/199592?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/199592?s=400&v=4 |
| og:image:alt | NoteMedium Risk Changes core msgpack unpack control flow and exception propagation for all unpackb and streaming unpack paths; behavior should match for normal errors but edge cases around C/Python... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/methane/msgpack-python git https://github.com/methane/msgpack-python.git |
| octolytics-dimension-user_id | 199592 |
| octolytics-dimension-user_login | methane |
| octolytics-dimension-repository_id | 1253023006 |
| octolytics-dimension-repository_nwo | methane/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 2242705 |
| octolytics-dimension-repository_parent_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5fe497b4815fcce3df76c0e246faa739a82c3124 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width