Skip to content
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

Handle python bug 30681 for invalid date parsing #47

Closed
nth-attempt opened this issue Sep 3, 2020 · 3 comments
Closed

Handle python bug 30681 for invalid date parsing #47

nth-attempt opened this issue Sep 3, 2020 · 3 comments
Assignees

Comments

@nth-attempt
Copy link

Currently the code does not handle the bug mentioned here https://bugs.python.org/issue30681

Following part of the code breaks since we are not catching TypeError and ValueError.

  753:      try:
  754:          raw_body.append((encoding, raw_body_str, msg.items()))
  755:      except AttributeError:

https://github.com/GOVCERT-LU/eml_parser/blob/master/eml_parser/eml_parser.py#L753-L755

Sample eml that can raise this bug

From: <[email protected]>
Orig-Date: Wed Jul 2020 23:11:43 +0100
@sim0nx
Copy link
Member

sim0nx commented Sep 4, 2020

Thanks for the report and the linked issue.
Since the PR was closed without being merged I submitted a new one to hopefully have this fixed upstream (python/cpython#22090).

Further I will how I can work around that issue. Feel free to submit a PR!

@sim0nx sim0nx self-assigned this Sep 4, 2020
sim0nx added a commit that referenced this issue Sep 11, 2020
@sim0nx
Copy link
Member

sim0nx commented Sep 11, 2020

I have just committed a workaround for your issue.
Could you please test the latest master to see if that fixes it ?

@nth-attempt
Copy link
Author

It worked :)

@sim0nx sim0nx closed this as completed Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants