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
Index out of range in get of message.EmailMessage.get() #75626
Comments
This error occured when the email field "From" was demanded: File "/home/user/processing/Test/process_email.py", line 84, in __init__ I used EmailPolicy, so the message object was instance of EmailMessage. |
I added 2 lines into the file "email/_header_value_parser.py" if not value:
value = ';'
return mailbox_list, value It is in attachments. |
Submitted pull request: |
I can't reproduce this issue on the latest master branch. This seems to be fixed as a part of a different PR I suppose. >>> import email
>>> msg = email.message_from_string("From: Bonifac Karaka : bonikar@gmail.com")
>>> msg['From']
'Bonifac Karaka : bonikar@gmail.com' This is very similar to bpo-32178, which also is now fixed. |
Note that the reporter indicated that the message was an instance of EmailMessage (the new API). You'd need to use policy-default to get that using message_from_string. But yes, this was fixed in another issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: