v3.19
Added 3
- Test on free-threaded CPython with the GIL disabled and document thread safety
- Expose the Unicode version of the generated tables as idna.unicode_version and show it in idna --version
- Add code, text, codepoint and position attributes to IDNAError so that the failed rule and the offending character can be identified
Changed 4
- Restore the std3_rules option, which had no effect since changes to UTS #46 processing in Unicode 16
- uts46_remap() now defaults to enabling STD3 rules, causing input containing non-LDH ASCII characters to be rejected
- Performance improvements to UTS #46 mapping, particularly for ASCII-only domains
- The deprecated transitional argument to encode() and uts46_remap() is now completely ignored, and gives a deprecation warning for the latter
Fixed 3
- Reject A-labels that are not the canonical Punycode encoding of their U-label
- Fix CONTEXTJ violations raising IDNAError instead of InvalidCodepointContext
- Consistently raise IDNAError for empty labels and non-ASCII bytes passed to label helper functions and the incremental codec
From idna
- Restore the
std3_rulesoption, which had no effect since changes to UTS #46 processing in Unicode 16. Note thatuts46_remap()defaults to enabling STD3 rules, so direct callers will see input containing non-LDH ASCII characters rejected again. - Performance improvements to UTS #46 mapping, particularly for ASCII-only domains.
- Test on free-threaded CPython with the GIL disabled and document thread safety.
- Expose the Unicode version of the generated tables as
idna.unicode_version, and show it inidna --version. - Add
code,text,codepointandpositionattributes toIDNAErrorso that the failed rule and the offending character can be identified without parsing the exception message. - The deprecated
transitionalargument toencode()anduts46_remap()is now completely ignored, and gives a deprecation warning for the latter. - Reject A-labels that are not the canonical Punycode encoding of their U-label.
- Fix CONTEXTJ violations raising
IDNAErrorinstead ofInvalidCodepointContext. - Consistently raise
IDNAErrorfor empty labels and non-ASCII bytes passed to label helper functions and the incremental codec. - Add property-based tests, extended fuzzing targets, coverage measurement, and CI checks that the data tables match the generator output.
- Various code quality and tooling improvements.
Thanks to stefan6419846, LouieLuNZ, and Salvatore Corvaglia for contributions to this release.