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.

classification
Title: Suppress expression chaining for RE parsing errors
Type: enhancement Stage: resolved
Components: Library (Lib), Regular Expressions Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, mrabarnett, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2022-04-05 12:41 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 32333 merged serhiy.storchaka, 2022-04-05 12:54
Messages (2)
msg416774 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-04-05 12:41
The EAFP principle is widely used in the regular expressions parsing code. Exceptions like KeyError, IndexError, ValueError or OverflowError raised during parsing are converted into a helpful re.error. Expression chaining is usually suppressed in such cases to hide unrelated implementation details, but not in all cases. The following PR adds more "from None" in "raise" statements inside "except" blocks.
msg416885 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-04-06 16:54
New changeset 50872dbadcba1f52867b6f76050cd7b5d0aa1e18 by Serhiy Storchaka in branch 'main':
bpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333)
https://github.com/python/cpython/commit/50872dbadcba1f52867b6f76050cd7b5d0aa1e18
History
Date User Action Args
2022-04-11 14:59:58adminsetgithub: 91383
2022-04-06 17:03:44serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-04-06 16:54:53serhiy.storchakasetmessages: + msg416885
2022-04-05 12:54:43serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request30390
2022-04-05 12:41:51serhiy.storchakacreate