This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Misleading error message for except with missing parens (3.10.a5)
Type: behavior Stage: resolved
Components: Versions: Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: aroberge, lys.nikolaou, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2021-02-06 22:54 by aroberge, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24467 closed pablogsal, 2021-02-07 03:28
PR 25996 merged pablogsal, 2021-05-08 16:20
PR 25997 merged miss-islington, 2021-05-08 18:24
Messages (3)
msg386570 - (view) Author: Andre Roberge (aroberge) * Date: 2021-02-06 22:54
The following:

except ValueError, NameError as err:

results in:

    except ValueError, NameError as err:
SyntaxError: expected ':'

However, what is missing here are some parentheses surrounding the exception types.
msg386601 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-02-07 18:42
New changeset 206cbdab16cb054e859597a562e2f6ab35e99766 by Pablo Galindo in branch 'master':
bpo-43149: Improve error message for exception group without parentheses (GH-24467)
msg393337 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-05-09 21:14
New changeset 9a0e65c8e05fdcd2207650d216ebdacdf0a025e9 by Miss Islington (bot) in branch '3.10':
bpo-43149: Correct the syntax error message for multiple exception types (GH-25996) GH-25997)
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87315
2021-05-09 21:14:08pablogsalsetmessages: + msg393337
2021-05-08 18:24:49miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request24650
2021-05-08 16:20:11pablogsalsetpull_requests: + pull_request24649
2021-02-07 18:42:41pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-02-07 18:42:28pablogsalsetmessages: + msg386601
2021-02-07 03:28:28pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23262
2021-02-07 01:01:52xtreaksetnosy: + lys.nikolaou, pablogsal
2021-02-06 22:54:08arobergecreate