diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-06 17:25:19 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-06 17:25:19 (GMT) |
commit | ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af (patch) | |
tree | bc2d7087980eca2ef81417d8a8f434487ac13004 | |
parent | 2d0eb65f455ddd66f74ad01a8f4a44d271f2a3da (diff) | |
parent | 53c53ea4c5440593a527bf3d106b5f7feebeed40 (diff) | |
download | cpython-ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af.zip cpython-ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af.tar.gz cpython-ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af.tar.bz2 |
Merge documentation for issue #27030 from 3.6.
-rw-r--r-- | Doc/library/re.rst | 7 | ||||
-rw-r--r-- | Doc/whatsnew/3.6.rst | 5 | ||||
-rw-r--r-- | Doc/whatsnew/3.7.rst | 5 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
4 files changed, 17 insertions, 3 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 218bbf8..adf3ddd 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -758,7 +758,12 @@ form. Unmatched groups are replaced with an empty string. .. versionchanged:: 3.6 - Unknown escapes consisting of ``'\'`` and an ASCII letter now are errors. + Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter + now are errors. + + .. versionchanged:: 3.7 + Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter + now are errors. .. function:: subn(pattern, repl, string, count=0, flags=0) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 040a533..3c2ab12 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2021,8 +2021,9 @@ API and Feature Removals ------------------------ * Unknown escapes consisting of ``'\'`` and an ASCII letter in - regular expressions will now cause an error. The :const:`re.LOCALE` - flag can now only be used with binary patterns. + regular expressions will now cause an error. In replacement templates for + :func:`re.sub` they are still allowed, but deprecated. + The :const:`re.LOCALE` flag can now only be used with binary patterns. * ``inspect.getmoduleinfo()`` was removed (was deprecated since CPython 3.3). :func:`inspect.getmodulename` should be used for obtaining the module diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index d306d40..14285d9 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -116,6 +116,11 @@ Deprecated Removed ======= +API and Feature Removals +------------------------ + +* Unknown escapes consisting of ``'\'`` and an ASCII letter in replacement + templates for :func:`re.sub` will now cause an error. Porting to Python 3.7 @@ -165,6 +165,9 @@ Core and Builtins Library ------- +- Issue #27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in + re.sub() replacement templates regular expressions now are errors. + - Issue #28835: Fix a regression introduced in warnings.catch_warnings(): call warnings.showwarning() if it was overriden inside the context manager. |