From fe37cdced4ada4864e9c645729cf833ae6f1f5be Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 12:38:45 +0100 Subject: [PATCH 1/4] Fix exception message in encodings.idna module Fix the 'Unsupported error handling' error message in the encodings.idna.IncrementalDecoder class. --- Lib/encodings/idna.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 78be4629be49aea398f0110837c35f4a18ac387b Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 12:59:44 +0100 Subject: [PATCH 2/4] Add blurb --- .../Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst 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..e727815b832785 --- /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 +:meth:`encodings.idna.IncrementalDecoder.decode` to correctly replace the +'errors' parameter. From 652d0b1342f95d4ea7d4aec47eecbcd7c7633e18 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 23:40:32 +0100 Subject: [PATCH 3/4] Fix blurb? --- .../next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index e727815b832785..0f1055e16e5214 100644 --- 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 @@ -1,3 +1,3 @@ Fix the "Invalid error handling" exception in -:meth:`encodings.idna.IncrementalDecoder.decode` to correctly replace the +:class:`encodings.idna.IncrementalDecoder` to correctly replace the 'errors' parameter. From 4d29daef00416c9a2bf1553e5c3e703c208aaeb2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 4 Jun 2025 14:22:55 +0100 Subject: [PATCH 4/4] Suppress nitpick warning from blurb --- .../next/Library/2025-06-03-12-59-17.gh-issue-135069.xop30V.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 0f1055e16e5214..1affb5e2aadab7 100644 --- 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 @@ -1,3 +1,3 @@ Fix the "Invalid error handling" exception in -:class:`encodings.idna.IncrementalDecoder` to correctly replace the +:class:`!encodings.idna.IncrementalDecoder` to correctly replace the 'errors' parameter.