gh-135069: Fix exception message in encodings.idna module (#135071)

This commit is contained in:
Daniel Hollas 2025-07-03 10:53:37 +01:00 committed by GitHub
parent 8f8bdf251a
commit 8dc3383abe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -316,7 +316,7 @@ class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
def _buffer_decode(self, input, errors, final):
if errors != 'strict':
raise UnicodeError("Unsupported error handling: {errors}")
raise UnicodeError(f"Unsupported error handling: {errors}")
if not input:
return ("", 0)

View file

@ -0,0 +1,3 @@
Fix the "Invalid error handling" exception in
:class:`!encodings.idna.IncrementalDecoder` to correctly replace the
'errors' parameter.