-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Description
bad-str-strip-call (PLE1310) in Ruff 0.9.4 flags a bytes.strip call when its argument is a str, but that is a false positive because bytes.strip does not accept a str argument.
$ cat >ple1310.py <<'# EOF'
b"".strip("//")
# EOF
$ python ple1310.py 2>&1 | tail -n 1
TypeError: a bytes-like object is required, not 'str'
$ ruff --isolated check --select PLE1310 ple1310.py --output-format concise
ple1310.py:1:11: PLE1310 String `strip` call contains duplicate characters
Found 1 error.PLE1310 does not flag a bytes.strip call when its argument is a bytes, which a false negative.
$ echo 'b"".strip(b"//")' | ruff --isolated check --select PLE1310 -
All checks passed!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule