-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
[WIP] bpo-37461: Fix email.parser.Parse hang #14551
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
[WIP] bpo-37461: Fix email.parser.Parse hang #14551
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the tests to Lib/test/test_email/test_parser.py and remove the Lib/email/test/__init__.py file.
Edit : There is also Lib/test/test_email/test__header_value_parser.py with similar tests that might be a better location.
|
I've got 2 broken tests and I would appreciate some guidance. |
|
Test case failures usually mean there is a regression where some behavior that was guaranteed previously is now being changed and there should be a good reason to change the tests. Sorry, email is not my expertise and maybe @maxking could help. |
|
This is a slightly different PoC, and this still hangs after applying the PR from email.parser import BytesParser, Parser
from email.policy import default
payload = "\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x78\x3b\x61\x72\x1b\x2a\x3d\x22\x73\x4f\x27\x23\x61\xff\xff\x27\x5c\x22\x3d\x72\x2d\x54\x79\x8e\xc4\x9e\x8d\xe4\xd5\xc2\x83\x7c\x7c\x7c"
Parser(policy=default).parsestr(payload) |
|
Thanks @n0npax for this patch! +1 on what @guidovranken says, I was going to comment but you beat me to it. I probably won't be able help too much for next 15 days, since I am travelling, but this PR doesn't fix the real problem. I was able to reproduce the problem with: Note the last Please make sure we don't delete any tests without proper reasoning about why we need to delete them :) |
|
I've got no idea how to solve this in a proper way. Closing PR. |
|
Sorry for fuss guys. Thanks for suggestions. |
https://bugs.python.org/issue37461
https://bugs.python.org/issue37461