Repository navigation
Add Python 3.16 support - #111
Merged
Merged
Conversation
Metadata/CI: - pyproject.toml: add 'Programming Language :: Python :: 3.16' classifier - .github/workflows/ci.yml: add 3.16 to linux matrix; bump other-matrix max from 3.15 to 3.16 Source fixes for two 3.16 stdlib behavior changes (verified on 3.16.0a2): 1. urllib.parse now validates ports eagerly at urlsplit()/urlparse() time, raising ValueError for non-integer ports (e.g. ':bad') instead of deferring to the .port property. gh-88037, listed under 'Porting to Python 3.16' in the 3.16 What's New. Three call sites in _urllib2_fork.py are wrapped in try/except ValueError: - _url_origin(): return the URL as its own origin - normalize_url(): return the URL unchanged - request_host(): fall back to the Host header 2. http.cookiejar.MozillaCookieJar.save() now writes '0' (not '') in the expires field for session cookies, matching curl/Wget convention. gh-61366. _clientcookie.py _really_load() now treats expires == '0' the same as the empty string: session cookie (expires=None, discard=True). All 346 tests pass on 3.10-3.16. ruff clean. Signed-off-by: Filipe Rosset <rosset.filipe@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Metadata/CI:
Source fixes for two 3.16 stdlib behavior changes (verified on 3.16.0a2):
urllib.parse now validates ports eagerly at urlsplit()/urlparse() time, raising ValueError for non-integer ports (e.g. ':bad') instead of deferring to the .port property. gh-88037, listed under 'Porting to Python 3.16' in the 3.16 What's New.
Three call sites in _urllib2_fork.py are wrapped in try/except ValueError:
http.cookiejar.MozillaCookieJar.save() now writes '0' (not '') in the expires field for session cookies, matching curl/Wget convention. gh-61366.
_clientcookie.py _really_load() now treats expires == '0' the same as the empty string: session cookie (expires=None, discard=True).
All 346 tests pass on 3.10-3.16. ruff clean.