HeaderParseError on email address ending with '.'
Open
Nobody has claimed this yet.
topic-email
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Bug report
from email.headerregistry import Address
a = Address("Jane Doe", addr_spec="jane_doe@example.org.")
[…]
HeaderParseError: expected atext but found ''
The issue is the trailing dot, which is arguably not great, but it's very valid actually, and the email address provided is the same as the email address without a dot.
Your environment
- CPython versions tested on: 3.11.1-1 on Debian unstable
- Operating system and architecture: Debian unstable, amd64
Linked PRs
- gh-151972
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with email.headerregistry.Address using the reproducer and inspect the header parsing path that handles the trailing dot in addr_spec. Compare the behavior with the equivalent address without the dot and review linked PR gh-151972; done means the valid trailing-dot address no longer raises HeaderParseError and has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100