Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

encodings.idna: Unexpanded f-string in "Unsupported error handling" exception #135069

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@danielhollas

Description

@danielhollas

Bug report

Bug description:

The exception string inencondings.idna.IncrementalDecoder is missing the 'f' prefix.

raiseUnicodeError("Unsupported error handling: {errors}")

The exception can be triggered with this snippet.

fromencodings.idnaimportIncrementalDecoderdecoder=IncrementalDecoder(errors='boom!')decoder.decode(b'')

On main

$./python test.pyTraceback (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.pyTraceback (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

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp