-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. #15044
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
Conversation
I will review this. |
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.
Works as suggested. Tested on Debian Stretch. Thank you @maxking 🌈
Lib/email/_header_value_parser.py
Outdated
@@ -582,7 +584,7 @@ def value(self): | |||
for x in self: | |||
if x.token_type == 'quoted-string': | |||
quote = True | |||
if quote: | |||
if self and quote: |
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.
in which case, self
would be None|False|0
?
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.
I think it should be len(self) != 0
for being more explicit, like in the method above, I'll make the changes.
This would be when the TokenList
is empty with no tokens.
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.
Overall looks good. Just one more minor suggestion. Please find my suggestion inline.
Misc/NEWS.d/next/Library/2019-07-30-22-41-05.bpo-32178.X-IFLe.rst
Outdated
Show resolved
Hide resolved
Co-Authored-By: Sanyam Khurana <[email protected]>
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.
You may re-run the Travis tests and they should pass. Just one more nit-pick.
Overall LGTM 🌮 💯
Thanks @maxking for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…:'. (pythonGH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178 (cherry picked from commit 09a1872) Co-authored-by: Abhilash Raj <[email protected]>
GH-15213 is a backport of this pull request to the 3.8 branch. |
GH-15214 is a backport of this pull request to the 3.7 branch. |
…:'. (pythonGH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178 (cherry picked from commit 09a1872) Co-authored-by: Abhilash Raj <[email protected]>
…:'. (GH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178 (cherry picked from commit 09a1872) Co-authored-by: Abhilash Raj <[email protected]>
…:'. (GH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178 (cherry picked from commit 09a1872) Co-authored-by: Abhilash Raj <[email protected]>
…:'. (pythonGH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178
…:'. (pythonGH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178
…:'. (pythonGH-15044) This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string. https://bugs.python.org/issue32178
This should fix the IndexError trying to retrieve
DisplayName.display_name
andDisplayName.value
when thevalue
is basically an empty string.https://bugs.python.org/issue32178
Automerge-Triggered-By: @maxking