Kaydet (Commit) ff3dbe91 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Merge documentation for issue #27030 from 3.6.

...@@ -758,7 +758,12 @@ form. ...@@ -758,7 +758,12 @@ form.
Unmatched groups are replaced with an empty string. Unmatched groups are replaced with an empty string.
.. versionchanged:: 3.6 .. 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) .. function:: subn(pattern, repl, string, count=0, flags=0)
......
...@@ -2021,8 +2021,9 @@ API and Feature Removals ...@@ -2021,8 +2021,9 @@ API and Feature Removals
------------------------ ------------------------
* Unknown escapes consisting of ``'\'`` and an ASCII letter in * Unknown escapes consisting of ``'\'`` and an ASCII letter in
regular expressions will now cause an error. The :const:`re.LOCALE` regular expressions will now cause an error. In replacement templates for
flag can now only be used with binary patterns. :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). * ``inspect.getmoduleinfo()`` was removed (was deprecated since CPython 3.3).
:func:`inspect.getmodulename` should be used for obtaining the module :func:`inspect.getmodulename` should be used for obtaining the module
......
...@@ -116,6 +116,11 @@ Deprecated ...@@ -116,6 +116,11 @@ Deprecated
Removed 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 Porting to Python 3.7
......
...@@ -165,6 +165,9 @@ Core and Builtins ...@@ -165,6 +165,9 @@ Core and Builtins
Library 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(): - Issue #28835: Fix a regression introduced in warnings.catch_warnings():
call warnings.showwarning() if it was overriden inside the context manager. call warnings.showwarning() if it was overriden inside the context manager.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment