Issue #27030: Unknown escapes in re.sub() replacement template are allowed
again. But they still are deprecated and will be disabled in 3.7.
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index ab37fd3..6aa49c3 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -947,7 +947,9 @@
this = chr(ESCAPES[this][1])
except KeyError:
if c in ASCIILETTERS:
- raise s.error('bad escape %s' % this, len(this))
+ import warnings
+ warnings.warn('bad escape %s' % this,
+ DeprecationWarning, stacklevel=4)
lappend(this)
else:
lappend(this)