]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-135069: Fix exception message in encodings.idna module (GH-135071) (#136235)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 3 Jul 2025 10:18:27 +0000 (12:18 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Jul 2025 10:18:27 +0000 (10:18 +0000)
gh-135069: Fix exception message in encodings.idna module (GH-135071)
(cherry picked from commit 8dc3383abea72ee3deafec60818aeb817d8fec09)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Lib/encodings/idna.py
Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst [new file with mode: 0644]

index 60a8d5eb227f8221652f81914c798eef05aa1172..0c90b4c9fe18fad8e2fa6f0dbb7ae39edb0726a3 100644 (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)
diff --git a/Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst b/Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst
new file mode 100644 (file)
index 0000000..1affb5e
--- /dev/null
@@ -0,0 +1,3 @@
+Fix the "Invalid error handling" exception in
+:class:`!encodings.idna.IncrementalDecoder` to correctly replace the
+'errors' parameter.