Replace codecs.open() with open() since codecs.open() deprecated in 3.14 #8447
+5
−4
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.
Replace
codecs.open()
withopen()
since the former is deprecated in Python 3.14codecs.open
was necessary in Python 2 because the built-inopen()
function could not handle different text encodings like UTF-8. It provided a way to read and write text files containing Unicode characters, which the default open() could not do without causing errors. With Python 3, the built-inopen()
function was changed to take an encoding argument and to handle text files as Unicode by defaultAlso:
uv.lock
to.gitignore
to make it easier to test with uv virtual environments using things like a release candidate version of PythonCloses #8446