Skip to content

Refresh Python 3.15 HTTP, URL and documentation libraries - #9193

Draft
youknowdot wants to merge 4 commits into
RustPython:mainfrom
youknowdot:split/http-documentation-315
Draft

youknowdot wants to merge 4 commits into
RustPython:mainfrom
youknowdot:split/http-documentation-315

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Split the connected HTTP/URL/documentation closure from #8954 onto current main. Refresh 10 production modules from CPython 3.15 pin d220409a13b77de7a6c30abe16ea90db01528edc: pydoc, pkgutil, webbrowser, http.client, http.server, http.cookiejar, http.cookies, urllib.parse, urllib.request, and wsgiref.simple_server, with their canonical tests and required pydoc data.

The dependency chain is real: pydoc uses pkgutil/URL parsing/HTTP server/browser helpers; server and request use the HTTP client and URL parser; request uses cookiejar; wsgiref uses the HTTP server. Data and unchanged modules are not counted toward the production-module total.

Canonical production bytes are preserved except for one explicitly reviewed updater transformation in pydoc: Cargo source builds use sys._stdlib_dir for the default stdlib classification. Explicit basedir, installed RustPython, and CPython behavior remain unchanged. The transformation requires the exact pinned source hash and exact file, and never refreshes unrelated dependencies. Its native prerequisite only exposes the existing platform-neutral source-directory predicate as sys._is_python_build and removes that predicate's Windows-only compilation guard.

All live test guards are preserved. Two obsolete targets are removed with upstream deletion evidence: the entire removed CGI test class, and a wsgiref forwarder calling a nonexistent canonical parent method. No new skip or expected failure hides the pydoc regression.

Verification

Fresh locked/offline release build on Linux, with normal, -E, and -I import provenance bound to this worktree. Full canonical pydoc now passes 118 tests and sysconfig passes 41, retaining existing platform/implementation markers. 296 updater tests and normal repository hooks pass.

All 13 scoped canonical suites reran on the new binary (949 reported tests plus four separately rerun selectors). Existing getpath tests pass 5/5; workspace tests report 1,400 passed/18 ignored, CAPI tests 123 passed/4 ignored. Both workspace and CAPI strict all-target Clippy pass. Workspace/CAPI embedded tests created only new bytecode caches; exact additions were hash-verified and quarantined, then full source audits passed. No original source changed.

Default external-network resource gates remain disabled; HTTP/TLS loopback and browser mocks are exercised. The inherited proxy causes the same urllib/urllib2 failures on the unchanged CPython oracle; four exact malformed-URL/mocked redirect selectors are separately verified with only their child proxy environment normalized. They do not make external connections. Historical oracle results are labeled historical comparisons, not new paired runs. AF_UNIX/ptrace and external network suites remain outside this runner's scope. macOS/Windows compilation is left to CI; local cross-platform execution is not claimed.

AI assistance

OpenAI Codex assisted with source selection, updater implementation, dependency review, validation, and this PR description. Model version is unavailable. Commits include the required Assisted-by trailer.

Import the connected documentation and HTTP/URL library closure from CPython d220409a13b77de7a6c30abe16ea90db01528edc using scripts/update_lib. Preserve surviving RustPython test guards; the upstream-removed CGI test class has no remaining marker target.

Assisted-by: OpenAI Codex:model version unavailable
Canonical Python 3.15 removed the target method; migrate with an empty marker override rather than retain an expected-failure call to a nonexistent super method.

Assisted-by: OpenAI Codex:model version unavailable
Expose the existing source-directory predicate as sys._is_python_build and regenerate pinned pydoc with the explicit updater transform shared with the mega repair. Installed layouts and explicit basedir arguments retain upstream behavior.

Assisted-by: OpenAI Codex:model version unavailable
The existing platform-neutral Lib and Cargo.toml predicate is needed by sys._is_python_build on all platforms; preserve its algorithm unchanged.

Assisted-by: OpenAI Codex:model version unavailable
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
[x] lib: cpython/Lib/http
[x] test: cpython/Lib/test/test_httplib.py (TODO: 1)
[x] test: cpython/Lib/test/test_http_cookiejar.py
[x] test: cpython/Lib/test/test_http_cookies.py
[x] test: cpython/Lib/test/test_httpservers.py

dependencies:

  • http

dependent tests: (52 tests)

  • http: test_docxmlrpc test_genericalias test_hashlib test_http_cookiejar test_http_cookies test_httplib test_httpservers test_logging test_robotparser test_ssl test_ucn test_unicodedata test_urllib test_urllib2 test_urllib2_localnet test_wsgiref test_xml_dom_xmlbuilder test_xmlrpc
    • logging.handlers: test_concurrent_futures test_pkgutil
    • pydoc: test_enum test_pydoc
      • pdb: test_pdb
    • urllib.request: test_pathlib test_sax test_site test_urllib2net test_urllibnet
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_json test_launcher test_netrc test_os test_pathlib test_peg_generator test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd

[ ] lib: cpython/Lib/urllib
[x] test: cpython/Lib/test/test_urllib.py
[x] test: cpython/Lib/test/test_urllib2.py
[x] test: cpython/Lib/test/test_urllib2_localnet.py
[ ] test: cpython/Lib/test/test_urllib2net.py
[x] test: cpython/Lib/test/test_urllibnet.py
[x] test: cpython/Lib/test/test_urlparse.py
[x] test: cpython/Lib/test/test_urllib_response.py
[x] test: cpython/Lib/test/test_robotparser.py

dependencies:

  • urllib (native: _scproxy, email.utils, http.client, http.cookiejar, math, sys, time, unicodedata, urllib.error, urllib.parse, urllib.request, urllib.response, winreg)
    • collections (native: _collections, _weakref, itertools, sys)
    • contextlib (native: sys)
    • ftplib (native: sys)
    • io (native: _io, _thread, errno, msvcrt, sys)
    • base64, bisect, email, fnmatch, functools, hashlib, ipaddress, mimetypes, os, re, socket, ssl, string, tempfile, types, warnings

dependent tests: (101 tests)

  • urllib: test_genericalias test_http_cookiejar test_http_cookies test_httpservers test_logging test_pathlib test_pydoc test_robotparser test_sax test_site test_sqlite3 test_ssl test_ucn test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib_response test_urllibnet test_urlparse
    • email.utils: test_email test_smtplib
      • http.server: test_xmlrpc
      • logging.handlers: test_concurrent_futures test_pkgutil
      • smtplib: test_smtpnet
    • http: test_docxmlrpc test_hashlib test_httplib test_unicodedata test_wsgiref test_xml_dom_xmlbuilder
      • pydoc: test_enum
    • mimetypes: test_mimetypes
    • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_json test_launcher test_netrc test_os test_pathlib test_peg_generator test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
      • compileall: test_compileall
      • importlib: test_asdl_parser test_bdb test_cmd_line_script test_codecs test_ctypes test_doctest test_external_inspection test_frozen test_importlib test_inspect test_linecache test_modulefinder test_multiprocessing_main_handling test_py_compile test_pyclbr test_reprlib test_sundry test_support test_unittest test_zipfile test_zipimport test_zoneinfo
      • traceback: test_asyncio test_builtin test_code_module test_contextlib test_contextlib_async test_coroutines test_dictcomps test_exceptions test_iter test_listcomps test_pyexpat test_setcomps test_socket test_subprocess test_sys test_threadedtempfile test_threading test_unittest test_with
      • zipapp: test_pdb

[x] lib: cpython/Lib/webbrowser.py
[x] test: cpython/Lib/test/test_webbrowser.py

dependencies:

  • webbrowser

dependent tests: (7 tests)

  • webbrowser: test_webbrowser
    • pydoc: test_enum test_pydoc
      • pdb: test_pdb
      • xmlrpc.server: test_docxmlrpc test_xmlrpc
    • wsgiref.simple_server: test_wsgiref

[ ] lib: cpython/Lib/pydoc.py
[x] lib: cpython/Lib/pydoc_data
[x] test: cpython/Lib/test/test_pydoc (TODO: 2)

dependencies:

  • pydoc (native: _pyrepl.pager, builtins, email.message, http.server, importlib._bootstrap, importlib._bootstrap_external, importlib.machinery, importlib.util, pydoc_data.topics, select, sys, time, urllib.parse)
    • pydoc_data
    • platform (native: _wmi, itertools, sys, vms_lib, winreg)
    • sysconfig (native: _sysconfig, _winapi, importlib.machinery, importlib.util, os.path, sys)
    • collections, io
    • future, annotationlib, ast, getopt, inspect, os, pkgutil, pydoc_data, re, reprlib, textwrap, threading, tokenize, traceback, warnings, webbrowser

dependent tests: (5 tests)

  • pydoc: test_enum test_pydoc
    • pdb: test_pdb
    • xmlrpc.server: test_docxmlrpc test_xmlrpc

[x] lib: cpython/Lib/pkgutil.py
[x] test: cpython/Lib/test/test_pkgutil.py

dependencies:

  • pkgutil

dependent tests: (10 tests)

  • pkgutil: test_pkgutil test_pydoc test_pyrepl test_runpy
    • pydoc: test_enum
      • pdb: test_pdb
      • xmlrpc.server: test_docxmlrpc test_xmlrpc
    • runpy:
      • profile: test_profile
      • trace: test_trace

[ ] lib: cpython/Lib/wsgiref
[x] test: cpython/Lib/test/test_wsgiref.py

dependencies:

  • wsgiref (native: collections.abc, headers, http.server, sys, time, urllib.parse, util, wsgiref.handlers)
    • io, platform
    • os, posixpath, re, traceback, types, typing, warnings, webbrowser

dependent tests: (1 tests)

  • wsgiref: test_wsgiref

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant