Skip to content

Enforce the email local-part limit in UTF-8 octets - #574

Open
prathamchoksi wants to merge 1 commit into
python-validators:masterfrom
prathamchoksi:fix/email-local-part-byte-limit
Open

prathamchoksi wants to merge 1 commit into
python-validators:masterfrom
prathamchoksi:fix/email-local-part-byte-limit

Conversation

@prathamchoksi

Copy link
Copy Markdown

Fixes #573.

Measure the email local part in UTF-8 octets instead of Unicode characters, as required by RFC 5321 section 4.5.3.1.1. A local part containing 33 \u00fc characters previously passed despite occupying 66 bytes; it now returns ValidationError. Exactly 64-byte local parts remain valid.

Adds ASCII, Unicode, and mixed-input boundary tests. tox --skip-missing-interpreters passes: lint, formatting, strict typing, security checks, and all 1,580 tests/doctests on Python 3.11 and 3.14. Python 3.12 and 3.13 were skipped because those interpreters are not installed.

Developed with Codex assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

email() counts Unicode characters instead of UTF-8 octets for the local-part limit

1 participant