#157675·Python

Slow IDNA encoding with large strings

Author: encukouCreated Sep 17, 2026Updated Sep 17, 2026
Labelstype-featurestdlib

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:

Linked PRs

  • gh-157682