Title: Align socket and socketserver with Python 3.15 final by youknowdot · Pull Request #9156 · RustPython/RustPython · GitHub
Open Graph Title: Align socket and socketserver with Python 3.15 final by youknowdot · Pull Request #9156 · RustPython/RustPython
X Title: Align socket and socketserver with Python 3.15 final by youknowdot · Pull Request #9156 · RustPython/RustPython
Description: Summary Split the socket/socketserver portion of #8954 into five files, synchronized with CPython 3.15 final (d220409a13b77de7a6c30abe16ea90db01528edc). Import the complete socket.py, socketserver.py, test_socket.py, and test_socketserver.py using the actual scripts/update_lib copy/migrate commands. Preserve all five existing AF_ALG expected-failure markers. No hand-edited library/test bodies, duplicate snippets, support-module changes, or workflows. Match setsockopt positional parsing, index-before-buffer conversion, and error ordering. Python conversions, warnings, and buffer acquisition finish before the socket lock; the socket guard drops before the buffer export is released. Correct final-CPython optlen semantics beyond the original mega patch: use the index protocol, mask to unsigned 32 bits, and issue DeprecationWarning("integer value out of range") outside [-2**31, 2**32 - 1]. Warning-as-error propagates before the third-argument shape check or host call. Reject Windows buffer lengths above INT_MAX before the host call. Preserve arbitrary-precision integer ports in getaddrinfo, accept index objects before string/bytes handling, and return an empty canonical name when the resolver supplies none. Provenance and overlap The three Python files other than test_socket.py match the pinned CPython blobs byte-for-byte. test_socket.py differs only by the five retained AF_ALG decorators. The tested commit is retained rather than rebased over unrelated main changes. At publication, the main-relative PR patch still contains exactly the reviewed five files. #9143 remains open and adds an expected-failure marker to test_getaddrinfo_int_port_overflow; that marker must be preserved if integrated because this run did not execute the real _testcapi-dependent body. The older socket overlap in #8007 concerns separate SSL/wait gating. Local validation Normal commit hooks, the matching narrow release build, and strict stdlib/VM all-targets Clippy passed: cargo build --release --offline --locked -p rustpython --bin rustpython -j1 \ --no-default-features --features threading,stdlib,stdio,importlib,host_env cargo clippy --release --offline --locked -p rustpython-stdlib -p rustpython-vm \ --all-targets --no-default-features \ --features rustpython-stdlib/compiler,rustpython-stdlib/host_env,rustpython-stdlib/threading,rustpython-vm/compiler,rustpython-vm/gc,rustpython-vm/host_env,rustpython-vm/stdio,rustpython-vm/importlib,rustpython-vm/encodings,rustpython-vm/threading \ -- -D warnings Eight unchanged canonical method extracts passed, each in a fresh bounded process: test_socket.GeneralModuleTests: testDefaultTimeout, testGetSockOpt, testSetSockOpt, test_setsockopt_errors, test_SocketType_is_socketobject, and testNewAttributes test_socketserver.TestModule.test_deprecated__version__ test_socketserver.MiscTestCase.test_all Four temporary supplemental checks passed: numeric-only getaddrinfo index/type/boundary/canonical-name cases; setsockopt optlen warnings and error order; a tiny native AF_UNIX socketpair/sendfile check; and socketserver attributes without starting a server. Every giant-optlen check supplied a non-None third argument and was rejected before host access. The sendfile fixture was 32 bytes, with 50 bytes transferred across the bounded cases; no external DNS was used. The additional canonical test_getaddrinfo_int_port_overflow naturally skipped because the real _testcapi module is absent. Its body remains untested; no fake module or constants were substituted. The runtime used the original library inventory with source/module-origin checks and time, memory, output, descriptor, and process limits. Initial missing native-math/IDNA admission failures were preserved, then corrected only in separately reviewed temporary import allowlists. No repository behavior or test assertion was changed to clear those gates. Source hashes remained unchanged across build, Clippy, and runtime, and an independent review checked the selected result receipts. This is bounded Linux coverage, not a full test_socket/test_socketserver or workspace-suite pass. Windows/macOS/BSD/WASI behavior, broad DNS/non-UTF8/SSL/AF_VSOCK parity, raw-device tests, and server/fork loops were not exercised. The Windows length guard was source-reviewed only. Validation identities: Commit: ed08422bea7d1483a9a5a615870b7339a5dcc76b Five-file patch SHA-256: e4493b63070d4578a60c1893273c5f791108a34d76781827730604d17b7c9624 Tested binary SHA-256: d44bdf898535141ef097c856552d332f1478443f69f14e515dc7307e1d288316 Result manifest SHA-256: 9f31d781770839feaebe550240542bf4ac7d5f4f3d7e09f54c58b6977e0bf36d AI assistance OpenAI Codex assisted with the implementation, canonical-source synchronization, source review, bounded validation, and this description. The exact model version was unavailable; the commit includes an Assisted-by trailer.
Open Graph Description: Summary Split the socket/socketserver portion of #8954 into five files, synchronized with CPython 3.15 final (d220409a13b77de7a6c30abe16ea90db01528edc). Import the complete socket.py, socketserver...
X Description: Summary Split the socket/socketserver portion of #8954 into five files, synchronized with CPython 3.15 final (d220409a13b77de7a6c30abe16ea90db01528edc). Import the complete socket.py, socketserver...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9156
X: @github
Domain: github.com
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:43b77fdc-19bf-bb27-7c19-fa41bbb600be |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D318:1C94F:2B8A4DA:37CF351:6B01F929 |
| html-safe-nonce | 6b21ef39173b9ac74a0cfbb99844c5c485c7664d17c5879c2b06afb5371a0236 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzE4OjFDOTRGOjJCOEE0REE6MzdDRjM1MTo2QjAxRjkyOSIsInZpc2l0b3JfaWQiOiIxNDUwNzc5MzkxMDUwMjUwNTM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1a7f0718e721d014bea297b539ea1f5e47716e7e9a6a7765aec6e75f3a7c695b |
| hovercard-subject-tag | pull_request:4874572743 |
| 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/9156/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Split the socket/socketserver portion of #8954 into five files, synchronized with CPython 3.15 final (d220409a13b77de7a6c30abe16ea90db01528edc). Import the complete socket.py, socketserver... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width