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: Convert a warning about flags not at the start of the regular expression into error
Type: behavior 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-03-19 12:09 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31994 merged serhiy.storchaka, 2022-03-19 12:33
Messages (2)
msg415544 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-03-19 12:09
This warning was introduced in 3.6. The reason is that in most other regular expression implementations global inline flags in the middle of the expression have different semantic: they affect only the part of the expression after the flag. But in Python they affect the whole expression. It caused confusion and was a source of bugs.

After 5 releases it is a time to convert this warning into error. In future we can allow global inline flags in the middle of the expression with different semantic. It is safer if one or more intermediate versions will raise an error.
msg415552 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-03-19 14:10
New changeset 92a6abf72e7a8274f96edbb5297119d4ff055be7 by Serhiy Storchaka in branch 'main':
bpo-47066: Convert a warning about flags not at the start of the regular expression into error (GH-31994)
https://github.com/python/cpython/commit/92a6abf72e7a8274f96edbb5297119d4ff055be7
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91222
2022-03-19 14:12:52serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-03-19 14:10:48serhiy.storchakasetmessages: + msg415552
2022-03-19 12:33:22serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request30084
2022-03-19 12:09:48serhiy.storchakacreate