Skip to content

[email] contains_token_type was backported to 3.11-3.13 - #16624

Open
hoangchunghien wants to merge 1 commit into
python:mainfrom
hoangchunghien:email-contains-token-type-backport
Open

hoangchunghien wants to merge 1 commit into
python:mainfrom
hoangchunghien:email-contains-token-type-backport

Conversation

@hoangchunghien

Copy link
Copy Markdown

#16596 added TokenList.contains_token_type and Terminal.contains_token_type behind sys.version_info >= (3, 14), for 3.14.9 and 3.15.1. CPython has since backported them to 3.11.18, 3.12.16 and 3.13.18. The previous patch on each branch doesn't have them: def contains_token_type is absent from Lib/email/_header_value_parser.py at v3.11.17, v3.12.15 and v3.13.17, and present at the three tags above. 3.10 doesn't have it.

That's the stdlib half of last night's failure (#16622). Only the Ubuntu jobs fail, because they already run 3.11.18, 3.12.16 and 3.13.18. The macOS runners are still on 3.11.9 and 3.12.10, and Windows passes too.

This changes:

  • the guard to sys.version_info >= (3, 11), with the comment listing all five releases;
  • darwin-py311/312/313.txt and win32-py311/312/313.txt, each gaining a temporary block in the existing "Remove once 3.x.y becomes available for GitHub Actions" form. win32-py313 and darwin-py313 had no Temporary section, so I added one at the top as in the py311/py312 files.

Checked in Docker:

  • python:3.13.18-slim and python:3.12.16-slim, full tests/stubtest_stdlib.py: no errors for email (the only errors are tkinter, turtle, _tkinter and one socket item, from the slim images lacking Tk).
  • python:3.13.15-slim, standing in for the older macOS/Windows patches: stubtest on email._header_value_parser reports the two methods as not present at runtime, and passes with the new allowlist entries.
  • mypy_test.py stdlib/email, check_typeshed_structure.py, flake8 and black pass.

No 3.11.18 image is published, so 3.11 rests on the CPython tags and the Ubuntu CI run.

Refs #16622 (the third-party half is #16623).

Python 3.11.18, 3.12.16 and 3.13.18 add TokenList.contains_token_type and
Terminal.contains_token_type, which python#16596 added for 3.14.9 and 3.15.1. The
daily stubtest run fails on the Ubuntu runners, which already have these
releases (python#16622). macOS and Windows runners are still on older patches, so
the darwin and win32 allowlists carry temporary entries until they update.
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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