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
bpo-35133: Fix mistakes when concatenate string literals on different lines. #10284
bpo-35133: Fix mistakes when concatenate string literals on different lines. #10284
Conversation
… lines. Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
@@ -2154,11 +2154,11 @@ def test_get_group_one_invalid(self): | |||
|
|||
def test_get_group_missing_final_semicol(self): | |||
group = self._test_get_x(parser.get_group, | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>,' | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>, ' | |||
'eric@where.test,John <jdoe@test>'), |
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.
What about the missing space before John
on this and subsequent lines? I realize it's not the issue you're solving, but since you're adding spaces after commas, do you need one here, too? Or maybe the point of this test is to not have spaces after commas? I haven't looked at it closely yet.
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.
These tests is the only thing about which I am unsure.
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.
The email team should look and decide. This again, is structured data, not English prose.
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'm not 100% positive, but I think it's okay in this case. I would wait for comment from @bitdancer though.
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 you should leave all the email tests alone. Having a mixture of spaces after commas and no spaces after commas is good thing in these tests, and although I don't remember for sure, most likely intentional.
The fixes for list errors and English misspellings (other than the assert failure message) look correct.
I think an email person (@bitdancer ) should look at the email test data formatting -- or omit the changes.
Lib/email/_header_value_parser.py
Outdated
@@ -2209,7 +2209,7 @@ def get_section(value): | |||
digits += value[0] | |||
value = value[1:] | |||
if digits[0] == '0' and digits != '0': | |||
section.defects.append(errors.InvalidHeaderError("section number" | |||
section.defects.append(errors.InvalidHeaderError("section number " | |||
"has an invalid leading 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.
section.defects.append(errors.InvalidHeaderError("section number "
"has an invalid leading 0"))
could evade the issue and be a bit more readable with
section.defects.append(errors.InvalidHeaderError(
"section number has an invalid leading 0"))
@@ -2154,11 +2154,11 @@ def test_get_group_one_invalid(self): | |||
|
|||
def test_get_group_missing_final_semicol(self): | |||
group = self._test_get_x(parser.get_group, | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>,' | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>, ' | |||
'eric@where.test,John <jdoe@test>'), |
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.
The email team should look and decide. This again, is structured data, not English prose.
@@ -2154,11 +2154,11 @@ def test_get_group_one_invalid(self): | |||
|
|||
def test_get_group_missing_final_semicol(self): | |||
group = self._test_get_x(parser.get_group, | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>,' | |||
('Monty Python:"Fred A. Bear" <dinsdale@example.com>, ' | |||
'eric@where.test,John <jdoe@test>'), |
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 you should leave all the email tests alone. Having a mixture of spaces after commas and no spaces after commas is good thing in these tests, and although I don't remember for sure, most likely intentional.
When you're done making the requested changes, leave the comment: |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @bitdancer: please review the changes made to this pull request. |
There are tools for multiline searching, but it was easier to me to write a simple Python script. |
The changes to test_email have be made as requested.
@bitdancer Since you have not re-reviewed since 44c6760 removed the changes to test_email, 4 days ago, I guessed that you must be busy. So your request was easy to confirm, I took the initiative of doing so in your behalf and dismissing your negative review, and giving Serhiy an OK to merge. If this annoys you, let me know that I should not repeat. |
Thanks @serhiy-storchaka for the PR |
GH-10334 is a backport of this pull request to the 3.7 branch. |
Thank you all for your reviews! |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
… lines. (pythonGH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings. (cherry picked from commit 34fd4c2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ferent lines. (pythonGH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.. (cherry picked from commit 34fd4c2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-10335 is a backport of this pull request to the 3.6 branch. |
…ferent lines. (pythonGH-10284) (pythonGH-10335) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.. (cherry picked from commit 34fd4c2). (cherry picked from commit 7054e5c)
Two kind of mistakes:
Missed space. After concatenating there is no space between words.
Missed comma. Causes unintentional concatenating in a list of strings.
https://bugs.python.org/issue35133