Skip to content

Slow IDNA encoding with large strings #157675

Closed

Description

@encukou

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

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Sep 17, 2026
  2. self-assigned this
    on Sep 17, 2026
  3. added a commit that references this issue on Sep 17, 2026
  4. added a commit that references this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions