[3.9] gh-98433: Fix quadratic time idna decoding. (GH-99092) (GH-99222) (#99230)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 10 Nov 2022 15:57:41 +0000 (07:57 -0800)
committerSean Whitton <spwhitton@spwhitton.name>
Thu, 20 Mar 2025 02:07:39 +0000 (10:07 +0800)
commit21de8de0ceccd8d4b16b01479242983caef0ac7b
treea64fbb8ed2884e2a63280d2a4feed8e090135b53
parentc3c8393ae721c094d553fcef7bfe050883d5fdc9
[3.9] gh-98433: Fix quadratic time idna decoding. (GH-99092) (GH-99222) (#99230)

There was an unnecessary quadratic loop in idna decoding. This restores
the behavior to linear.

(cherry picked from commit d315722564927c7202dd6e111dc79eaf14240b0d)
(cherry picked from commit a6f6c3a3d6f2b580f2d87885c9b8a9350ad7bf15)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0011-3.9-gh-98433-Fix-quadratic-time-idna-decoding.-GH-99.patch
Lib/encodings/idna.py
Lib/test/test_codecs.py