-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new Python Bug to Header Parsing Issue #41
Comments
Thanks for your analysis. Regarding the workaround, this is still necessary though, same on 3.7 as on 3.8. I just retested it with the problematic sample included in the samples folder of this repo. Regarding your suggestion, _header_value_parser is private so I can't include that one. I haven't tested it but from looking at that function I don't think it would solve the issue I am trying to workaround "Test.[email protected]". |
When an email header address field contains a period directly before the angle bracket, the default header policy raises an Attribute error, rather than adding a header defect. GOVCERT-LU/eml_parser#41
With the modification to the Python 3.7 email._header_value_parser.py, the following is my output. This causes test_headeremail2list_2 to fail, as intended, because the default Python header parser succeeds. I created pull request 18687 to address this issue.
|
Great! Thank you! |
This appears to be related to this issue. The pull request I made only addresses one case, I'll look at addressing the other later this week. |
This pull addresses the issue more completely, so I closed my pull request. The following can be used to
|
An upstream fix should be deployed, I'll try to find time to check this week. |
It is fixed in Python 3.13.0b1, so it should make it into Python 3.13 this fall.
|
In
test_headeremail2list_2
, it mentions Python bug 27257. However, Bug 27257 appears to be related to empty groups in the header, not issues with obsolete period. With Python 3.7, I do not have any issues with the decoded value, unless the eml_parser should include address groups.eml_parser/tests/test_emlparser.py
Line 131 in f98980a
From the bug:
From the RFC:
I have not found a related issue in the Python bug tracker, but perhaps something like the following in
_header_value_parser.py
would be appropriate to prevent the exception:The text was updated successfully, but these errors were encountered: