classification
Title: Improve syntax errors for missing commas
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2021-04-13 01:30 by pablogsal, last changed 2021-07-18 15:31 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25377 closed pablogsal, 2021-04-13 01:32
PR 25866 merged pablogsal, 2021-05-03 23:59
PR 25869 closed miss-islington, 2021-05-04 00:32
PR 25870 merged miss-islington, 2021-05-04 00:49
Messages (4)
msg390916 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-04-13 01:30
Given that is quite common to forgot a comma in containers, function calls, ...etc and that the current error is:

>>> [a, b, c d]
  File "<stdin>", line 1
    [a, b, c d]
             ^
SyntaxError: invalid syntax

We could improve the user experience quite a lot if we mention that probably the user forgot a comma:

>>> [a, b, c d]
  File "<stdin>", line 1
    [a, b, c d]
             ^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
msg391152 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-04-15 20:38
New changeset b280248be8e648feb82f3f3ed0050e50b238df7b by Pablo Galindo in branch 'master':
bpo-43822: Improve syntax errors for missing commas (GH-25377)
https://github.com/python/cpython/commit/b280248be8e648feb82f3f3ed0050e50b238df7b
msg392846 - (view) Author: miss-islington (miss-islington) Date: 2021-05-04 01:06
New changeset 756b7b9248885d65c2b3b9f1c5a8f66aa2e8de7a by Miss Islington (bot) in branch '3.10':
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
https://github.com/python/cpython/commit/756b7b9248885d65c2b3b9f1c5a8f66aa2e8de7a
msg392847 - (view) Author: miss-islington (miss-islington) Date: 2021-05-04 01:07
New changeset d1ff838d1091853ed6f56bc1573606dc0d74a691 by Miss Islington (bot) in branch '3.10':
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
https://github.com/python/cpython/commit/d1ff838d1091853ed6f56bc1573606dc0d74a691
History
Date User Action Args
2021-07-18 15:31:01pablogsalsetpull_requests: - pull_request25769
2021-07-18 15:26:31pablogsalsetpull_requests: + pull_request25769
2021-05-04 01:07:46miss-islingtonsetmessages: + msg392847
2021-05-04 01:06:55miss-islingtonsetmessages: + msg392846
2021-05-04 00:49:03miss-islingtonsetpull_requests: + pull_request24550
2021-05-04 00:32:56miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request24549
2021-05-03 23:59:43pablogsalsetpull_requests: + pull_request24547
2021-04-15 22:07:56pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-15 20:38:55pablogsalsetmessages: + msg391152
2021-04-13 01:32:44pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request24109
2021-04-13 01:30:43pablogsalcreate