Add Python 3.15 path HTTP and importlib updates#15737
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| if sys.version_info >= (3, 13): | ||
| if sys.version_info >= (3, 15): | ||
| pass | ||
| elif sys.version_info >= (3, 13): |
There was a problem hiding this comment.
Actually @srittau do you have strong opinions on how cases like this should be formatted? We have one set of slots for 3.10/3.11, another for 3.12, yet another for 3.13/3.14, and then no slots in 3.15. We could instead wrap up the whole thing in an if sys.version_info < (3, 15):, but that means the rest gets indented more.
There was a problem hiding this comment.
I find a double indent slightly more readable as it makes it clear that the following was removed in 3.15, while I find the "empty" branch a bit weird. But I don't really have a strong opinion, so let's use what you prefer.
There was a problem hiding this comment.
All right, I'll change it. Your version will also make the edit easier when we drop support for 3.12.
| def as_uri(self) -> str: ... | ||
| def is_absolute(self) -> bool: ... | ||
| if sys.version_info >= (3, 13): | ||
| if sys.version_info >= (3, 15): |
There was a problem hiding this comment.
This is sort of similar. The method has been there since the beginning, deprecated since 3.13, gone in 3.15. In this case we shouldn't unconditionally mark it as deprecated, because the replacement (os.path.isreserved) is also new in 3.13.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Summary
Add Python 3.15 stdlib updates for path helpers, HTTP helpers, importlib, inspect, pydoc, pathlib, glob, and zipimport.
Relevant report entries
genericpath.ALL_BUT_LAST,posixpath.ALL_BUT_LAST, andntpath.ALL_BUT_LAST, and updated several path helpers to positional-only signatures (CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/genericpath.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/posixpath.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/ntpath.py)http.client.HTTPConnection(max_response_headers=...)andHTTPSConnection(max_response_headers=...)(CPython PR: http.client._MAXHEADERS = 100 limit no longer sufficient cpython#131724; source: https://github.com/python/cpython/blob/main/Lib/http/client.py)http.serverdefault_content_typeandSimpleHTTPRequestHandler(extra_response_headers=...); removedCGIHTTPRequestHandlerfor 3.15 (CPython PRs: default http content-type cpython#113471, gh-135056: Add a --header CLI argument to http.server cpython#135057, Removehttp.server.CGIHTTPRequestHandlerand--cgiflag support cpython#133810; source: https://github.com/python/cpython/blob/main/Lib/http/server.py)inspect.getdoc(inherit_class_doc=..., fallback_to_class_doc=...)(CPython PR: Share code for getdoc() between inspect and pydoc cpython#132686; source: https://github.com/python/cpython/blob/main/Lib/inspect.py)importlib.resources.abc.Traversable.read_text(errors=...)(CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/importlib/resources/abc.py)importlib.metadata.DeprecatedNonAbstract, keptDistributionandPathDistributionas ABCs, and updated 3.15importlib.metadata.__all__/MetadataNotFound(CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/importlib/metadata/__init__.py)opcode.opmaptofrozendictand addedpathlib.PurePath.__vfspath__()for Python 3.15 (CPython sources: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/opcode.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/pathlib/__init__.py)pstats.Stats.print_call_subheading()andpydoc.Doc.STDLIB_DIR; changedpydoc.Doc.getdocloc(basedir=None)(CPython sources: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/pstats.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/pydoc.py)glob.glob0,glob.glob1,platform.java_ver,pathlib.PurePath.is_reserved, andzipimport.zipimporter.load_modulefor 3.15 (sources: https://github.com/python/cpython/blob/main/Lib/glob.py, https://github.com/python/cpython/blob/main/Lib/platform.py, https://github.com/python/cpython/blob/main/Lib/pathlib/__init__.py, https://github.com/python/cpython/blob/main/Lib/zipimport.py)