-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Closed
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The exception string in encondings.idna.IncrementalDecoder
is missing the 'f' prefix.
Line 319 in 3612d8f
raise UnicodeError("Unsupported error handling: {errors}") |
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 python@3.12 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 versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error