classification
Title: Backport warnings in the re module to 2.7
Type: enhancement Stage: resolved
Components: Extension Modules, Library (Lib), Regular Expressions Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ezio.melotti, mrabarnett, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-05-14 12:16 by serhiy.storchaka, last changed 2017-05-18 09:50 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1577 merged serhiy.storchaka, 2017-05-14 12:22
Messages (2)
msg293645 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-14 12:16
The life of 2.7 is so long that our common practice of releasing one or two versions with warnings before removing a feature or changing the behavior in incompatible way doesn't work. People that will start porting to Python 3 in 2020 will be surprised.

Proposed patch backports warnings in the re module to 2.7 in py3k mode. Some of these warnings already are converted to errors, but the most important warnings are warnings about changing semantic. '\u' and '\U' have different meaning in 3.3+ (see issue3665). re.split() with potentially empty pattern now emits FutureWarning and will change the behavior in future versions (see issue22818).

Warnings about inline flags occurred not at the start of the regular expression (see issue22493 and issue30298) was not backported. Adding them requires changing the fnmatch module, non-trivially changing distutils, and likely will break third-party libraries.

Warnings are emitted only when Python is ran with the -3 option, and it is easy to fix regular expressions.
msg293915 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-18 09:34
New changeset 955b6760cfa73c54bae9b6f2b335eb0cd806c7b0 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-30363: Backport warnings in the re module. (#1577)
https://github.com/python/cpython/commit/955b6760cfa73c54bae9b6f2b335eb0cd806c7b0
History
Date User Action Args
2017-05-18 09:50:39serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-05-18 09:34:42serhiy.storchakasetmessages: + msg293915
2017-05-14 12:22:53serhiy.storchakasetpull_requests: + pull_request1670
2017-05-14 12:16:10serhiy.storchakacreate