[issue28128] Improve the warning message for invalid escape sequences

Emanuel Barry report at bugs.python.org
Fri Sep 16 10:34:26 EDT 2016


Emanuel Barry added the comment:

Personally I'd be fine with only one warning, reporting the first invalid escape. Presumably the string would be checked as a whole, or would get an r prefix. Patch seems like a good start; bytes would also need updating in that regard. Don't worry too much about the details, we can iron that out later :)

Also yeah, the fact that warnings are triggered at compile time results in surprising behaviour even for me. I'm liking the idea of a DeprecatedSyntaxWarning more.

I'll try to get some work done in that regard by the end of next week, but life's been somewhat busy so I can't give any guarantees. Thank you for your patch draft though, it helps me to figure out how I should tackle this!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28128>
_______________________________________


More information about the Python-bugs-list mailing list