-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 fix is unsafe #11461
Comments
I'm sorry, I don't understand the difference between the two snippets. I something being obscured by GitHub's formatting? |
Sorry I made a mistake, I fixed it. In short, the first backslash ( >>> "\
... "
''
>>> r"\
... "
'\\\n' |
Is this an unsafe fix or is this just a bug that we should fix? |
I think it is a bug that should be fixed, and due to this bug, the current fix is unsafe. |
Let's fix the bug rather than changing the safety. |
## Summary We weren't treating the escaped newline as a valid condition to trigger the safer fix (add an extra backslash before each invalid escape sequence). Closes #11461.
Before fix:
The original output:
$ python test_w605.py test\.
Fix it:
The file becomes
Run it again:
$ python test_w605.py \ test\.
The output changes. So the fix is unsafe.
The text was updated successfully, but these errors were encountered: