Title: Match CPython unsigned socket conversion errors by kyokuping · Pull Request #8257 · RustPython/RustPython · GitHub
Open Graph Title: Match CPython unsigned socket conversion errors by kyokuping · Pull Request #8257 · RustPython/RustPython
X Title: Match CPython unsigned socket conversion errors by kyokuping · Pull Request #8257 · RustPython/RustPython
Description: Assisted-by: Codex:gpt-5.4 Closes #xxxx This PR follows our AI policy Summary Fixed test_socket.GeneralModuleTests.testNtoHErrors by aligning RustPython’s socket.htons(), socket.htonl(), socket.ntohs(), and socket.ntohl() error handling with CPython. This change makes the socket byte-order conversion helpers accept indexable Python objects, route conversion through the shared unsigned integer path, and raise ValueError for negative inputs instead of incorrectly surfacing OverflowError. It also updates the shared integer conversion helper so unsigned primitive conversions report the CPython-style negative-number error, which lets the expected-failure marker be removed from Lib/test/test_socket.py. Summary by CodeRabbit Bug Fixes Updated socket ancillary-data helpers to accept Python integer-like inputs and correctly raise overflow/out-of-range errors. Improved IPv6 address tuple parsing for the optional flowinfo value. Prevented negative integers from converting to unsigned integer types, raising a clear ValueError. Aligned integer array element conversion with the same unsigned/primitive conversion rules. Improved Windows waitstatus_to_exitcode input handling to accept Python integer-like values consistently.
Open Graph Description: Assisted-by: Codex:gpt-5.4 Closes #xxxx This PR follows our AI policy Summary Fixed test_socket.GeneralModuleTests.testNtoHErrors by aligning RustPython’s socket.htons(), socket.htonl(), so...
X Description: Assisted-by: Codex:gpt-5.4 Closes #xxxx This PR follows our AI policy Summary Fixed test_socket.GeneralModuleTests.testNtoHErrors by aligning RustPython’s socket.htons(), socket.htonl(), so...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8257
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:29dbf085-926d-87da-c986-ad5d984c8f52 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8250:3E5B83:23FD27B:33D6D49:6A58F299 |
| html-safe-nonce | 9ba797cc2104e6b2dcf3546308040eed1c0f601165d9188b2b0d8147f4b077bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjUwOjNFNUI4MzoyM0ZEMjdCOjMzRDZENDk6NkE1OEYyOTkiLCJ2aXNpdG9yX2lkIjoiNzc5NjMyNTU4NTI3Mjc5NzY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b8d33bbe4c3e9c07de2372483f9ec295b249e5b39765f120c6311518e5753653 |
| hovercard-subject-tag | pull_request:4036790457 |
| 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/RustPython/RustPython/pull/8257/files |
| twitter:image | https://avatars.githubusercontent.com/u/109906379?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/109906379?s=400&v=4 |
| og:image:alt | Assisted-by: Codex:gpt-5.4 Closes #xxxx This PR follows our AI policy Summary Fixed test_socket.GeneralModuleTests.testNtoHErrors by aligning RustPython’s socket.htons(), socket.htonl(), so... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width