You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeprecationWarning not reported for invalid escape sequences #72540
bpo-28128: Improve the warning message for invalid escape sequences
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-10-04.09:06:49.730>created_at=<Date2016-10-04.09:00:39.484>labels= ['interpreter-core']
title='DeprecationWarning not reported for invalid escape sequences'updated_at=<Date2016-10-04.09:06:49.728>user='https://github.com/skirpichev'
We know from release notes, that "A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning". Sometimes it's true:
$ python -W error
Python 3.6.0b1+ (default, Oct 4 2016, 08:47:51)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> "xxx"!="hello \world"
DeprecationWarning: invalid escape sequence '\w'
But shouldn't DeprecationWarning be in the following case as well?
Activity
skirpichev commentedon Oct 4, 2016
But shouldn't DeprecationWarning be in the following case as well?
$ cat a.py def f(s): return s != "hello \world" $ cat b.py import a print(a.f("xxx")) $ python b.py True $ python -W error b.py Trueserhiy-storchaka commentedon Oct 4, 2016
See bpo-28128.
A warning should be emitted when you compile the code, but it shouldn't be emitted when you import compiled module.