https://github.com/python/cpython/commit/4bc9c018d1a04cf15a8cc35154949bf040c81c9c
commit: 4bc9c018d1a04cf15a8cc35154949bf040c81c9c
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2025-07-03T10:18:27Z
summary:

[3.14] gh-135069: Fix exception message in encodings.idna module (GH-135071) 
(#136235)

gh-135069: Fix exception message in encodings.idna module (GH-135071)
(cherry picked from commit 8dc3383abea72ee3deafec60818aeb817d8fec09)

Co-authored-by: Daniel Hollas <[email protected]>

files:
A Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst
M Lib/encodings/idna.py

diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py
index 60a8d5eb227f82..0c90b4c9fe18fa 100644
--- a/Lib/encodings/idna.py
+++ b/Lib/encodings/idna.py
@@ -316,7 +316,7 @@ def _buffer_encode(self, input, errors, final):
 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
index 00000000000000..1affb5e2aadab7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst
@@ -0,0 +1,3 @@
+Fix the "Invalid error handling" exception in
+:class:`!encodings.idna.IncrementalDecoder` to correctly replace the
+'errors' parameter.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to