This is the opposite of #98433 which concerned IDNA decoding.
IDNA uses the quadratic-complexity codec punycode, making it slow with large inputs.
We do check the limit (64 bytes per label), but too late (after the quadratic step is done).
Note that #155475 added documentation warnings, urging users to limit the input size:
Activity
pythongh-157675: Add *limit* argument to encodings.idna.nameprep
gh-157675: Add *limit* argument to encodings.idna.nameprep (GH-157682)