diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-08-19 10:19:59 -0700 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-09-10 09:13:45 -0700 |
commit | 13d2bd200911850dacde31665235122d85290265 (patch) | |
tree | 1765e8f9b4f0efa4601ab8457e187c5e83c3e2c0 /docs/intro.rst | |
parent | 769ea413d1b998628c60613c2e0c3dfa97b33c30 (diff) | |
download | pep8-13d2bd200911850dacde31665235122d85290265.tar.gz |
Add W605 warning for invalid escape sequences in string literals
Starting with Python 3.6, invalid escape sequences in string literals
are now deprecated. In a future version of Python, invalid escape
sequences will be a syntax error. While this deprecation produces a
runtime warning, it only appears if warnings are enabled and the first
time the Python source is compiled to byte code. By adding a check to
pycodestyle, projects can take advantage of static analysis to catch and
fix these future syntax errors.
For more information on the deprecation, see the Python release notes,
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
> A backslash-character pair that is not a valid escape sequence now
> generates a DeprecationWarning. Although this will eventually become a
> SyntaxError, that will not be for several Python releases.
Fixes #633
Diffstat (limited to 'docs/intro.rst')
-rw-r--r-- | docs/intro.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/intro.rst b/docs/intro.rst index fcdcf72..3035a2f 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -413,6 +413,8 @@ This is the current list of error and warning codes: +------------+----------------------------------------------------------------------+ | W604 | backticks are deprecated, use 'repr()' | +------------+----------------------------------------------------------------------+ +| W605 | invalid escape sequence '\x' | ++------------+----------------------------------------------------------------------+ **(*)** In the default configuration, the checks **E121**, **E123**, **E126**, |