COMP: Bump pyupgrade v3.19.0 to v3.21.2 for Python 3.14#6046
Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:mainfrom Apr 13, 2026
Merged
Conversation
Contributor
|
| Filename | Overview |
|---|---|
| .pre-commit-config.yaml | Bumps pyupgrade from v3.19.0 to v3.21.2 to fix Python 3.14 incompatibility with tokenize.cookie_re |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[pre-commit run] --> B{Python version}
B -- Python ≤ 3.13 --> C[pyupgrade v3.19.0\nworks fine]
B -- Python 3.14 --> D[pyupgrade v3.19.0\ncrashes: TypeError\ncookie_re bytes vs str]
D --> E[Bump to v3.21.2]
E --> F[pyupgrade v3.21.2\nhandles both bytes\nand str cookie_re]
F --> G[pre-commit passes]
C --> G
Reviews (1): Last reviewed commit: "COMP: Bump pyupgrade v3.19.0 to v3.21.2 ..." | Re-trigger Greptile
dzenanz
approved these changes
Apr 13, 2026
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.
Fix
pre-commit run -afailure when pixi provides Python 3.14. pyupgrade v3.19.0 crashes withTypeError: cannot use a bytes pattern on a string-like objectbecause Python 3.14 changedtokenize.cookie_refrom bytes to str.Error trace
Fixed upstream in asottile/pyupgrade. v3.21.2 handles both bytes and str
cookie_revariants.