classification
Title: Bugs in concatenating string literals on different lines
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, miss-islington, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-11-01 12:35 by serhiy.storchaka, last changed 2018-11-05 16:19 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
fixstringssplit.py serhiy.storchaka, 2018-11-05 12:33
Pull Requests
URL Status Linked Edit
PR 10284 merged serhiy.storchaka, 2018-11-01 12:40
PR 10334 merged miss-islington, 2018-11-05 14:20
PR 10335 merged serhiy.storchaka, 2018-11-05 14:56
PR 10336 merged serhiy.storchaka, 2018-11-05 15:46
Messages (7)
msg329059 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-01 12:35
The following PR fixes many bugs related to concatenating string literals on different lines. There are two kinds of errors:

1. Missed space. The first line is ended with a word, and the second line is started with a word. When they are concatenated, there is no space between words. This is the same issue as issue35128, but not only in warning messages, and not only in Python.

2. Missed comma in a list of string literals. This leads to concatenating the last string in the first line and the first list in the second line.
msg329084 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-01 17:58
I am only unsure about email tests. Barry, David, could you please look? There may be errors in tests, but it may be that spaces are intentionally omitted, for testing cases without spaces. Tests are passed in any case, but I don't know the purpose of these tests.
msg329296 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-05 12:33
Here is a script used for searching and fixing such errors. It produces a large number of false detections, so it need manual work for clearing the result. In general this can't be automated, because the correctness depends on the context.
msg329299 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-05 14:20
New changeset 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d by Serhiy Storchaka in branch 'master':
bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284)
https://github.com/python/cpython/commit/34fd4c20198dea6ab2fe8dc6d32d744d9bde868d
msg329301 - (view) Author: miss-islington (miss-islington) Date: 2018-11-05 14:53
New changeset 7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 by Miss Islington (bot) in branch '3.7':
bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284)
https://github.com/python/cpython/commit/7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6
msg329302 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-05 15:13
New changeset 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d by Serhiy Storchaka in branch '3.6':
[3.6] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335)
https://github.com/python/cpython/commit/7054e5c80b6e98cd44e22d1bc2d7f0a94343089d
msg329304 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-05 16:16
New changeset 3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336)
https://github.com/python/cpython/commit/3e3e1a27f769b3385853fbcad6749e71ca7f3ce3
History
Date User Action Args
2018-11-05 16:19:59serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 2.7
2018-11-05 16:16:29serhiy.storchakasetmessages: + msg329304
2018-11-05 15:46:20serhiy.storchakasetpull_requests: + pull_request9641
2018-11-05 15:13:55serhiy.storchakasetmessages: + msg329302
2018-11-05 14:56:04serhiy.storchakasetpull_requests: + pull_request9640
2018-11-05 14:53:09miss-islingtonsetnosy: + miss-islington
messages: + msg329301
2018-11-05 14:20:47miss-islingtonsetpull_requests: + pull_request9639
2018-11-05 14:20:28serhiy.storchakasetmessages: + msg329299
2018-11-05 12:33:36serhiy.storchakasetfiles: + fixstringssplit.py

messages: + msg329296
2018-11-01 17:58:17serhiy.storchakasetnosy: + barry, r.david.murray
messages: + msg329084
2018-11-01 12:40:35serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request9595
2018-11-01 12:35:09serhiy.storchakacreate