-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
W605 error while checking docstrings with regex inside it (again) v.2.5.0 #854
Comments
The lint is correct here, that docstring will become a syntax error in 3.8 You want to prefix your docstring with an The linked PR only corrects the position of the error message If you'd like a tool which will autofix this, one of the automatic rewrites of pyupgrade covers this |
@asottile ah thanks for the clarification. So, in 3.8 this docstring would also give a syntax error? def foo():
"""add C:\Program Files\Git\bin on Windows to the PATH"""
pass Currently giving
|
yes, that one will as well in fact today it produces what you probably wouldn't expect due to
If you want to see the py38 behaviour and have access to py36 / py37 you can use: $ python3.7 -Werror -c '"""foo\qar"""'
File "<string>", line 1
SyntaxError: invalid escape sequence \q |
Ah brilliant, thanks a ton for clarifying! |
Need to escape the single slash in docstring regexes. It is an error in Python 3.8 See PyCQA/pycodestyle#854 for
This is the same issue as #822 and #795, it is giving the same error.
Error:
W605 invalid escape sequence '\.'
Version:
It was supposed to be fixed by #818 and merged to the master. However, the error persists. Any workarounds?
The text was updated successfully, but these errors were encountered: