We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The exception string in encondings.idna.IncrementalDecoder is missing the 'f' prefix.
encondings.idna.IncrementalDecoder
cpython/Lib/encodings/idna.py
Line 319 in 3612d8f
The exception can be triggered with this snippet.
from encodings.idna import IncrementalDecoder decoder = IncrementalDecoder(errors='boom!') decoder.decode(b'')
On main
$ ./python test.py Traceback (most recent call last): File "/home/hollas/software/cpython/test.py", line 3, in <module> decoder.decode(b'') ~~~~~~~~~~~~~~^^^^^ File "<frozen codecs>", line 325, in decode File "/home/hollas/software/cpython/Lib/encodings/idna.py", line 319, in _buffer_decode raise UnicodeError("Unsupported error handling: {errors}") UnicodeError: Unsupported error handling: {errors}
The issue also exists on Python 3.13 and 3.14, but not on 3.12
$ uvx [email protected] test.py Traceback (most recent call last): File "/home/hollas/software/cpython/test.py", line 3, in <module> decoder.decode(b'') File "<frozen codecs>", line 322, in decode File "/usr/lib64/python3.12/encodings/idna.py", line 264, in _buffer_decode raise UnicodeError("Unsupported error handling "+errors) UnicodeError: Unsupported error handling boom!
(I'll submit a PR shortly)
CPython main branch
No response
The text was updated successfully, but these errors were encountered:
Note: I was inspired by the same issue reported in #134970 and used ruff linter to find this bug, specifically its RUF024 (missing-f-string-syntax) rule.
ruff check --target-version=py314 --preview --select RUF027 Lib/
It found two other hits in Lib/test/support/__init__.py, I'll file a separate issue for those.
Lib/test/support/__init__.py
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
The exception string in
encondings.idna.IncrementalDecoder
is missing the 'f' prefix.cpython/Lib/encodings/idna.py
Line 319 in 3612d8f
The exception can be triggered with this snippet.
On main
The issue also exists on Python 3.13 and 3.14, but not on 3.12
(I'll submit a PR shortly)
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: