-
Notifications
You must be signed in to change notification settings - Fork 2k
ISC001 fix can modify octal escape sequences #12936
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome
Description
The fix for ISC001 changes behavior when the first string ends with a one- or two-digit octal escape sequence and the second begins with an octal digit.
$ ruff --version
ruff 0.6.0
$ cat isc001.py
print("\12""0")
$ python isc001.py
0
$ ruff check --isolated --select ISC001 isc001.py --fix
Found 1 error (1 fixed, 0 remaining).
$ python isc001.py
PThe least disruptive fix would be to detect this specific situation and pad the escape sequence to three digits. In the above example, that would result in "\0120".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome