-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
fp = open(1)
def f() -> int:
return 1
fp = open(f())
def g(x: int) -> None:
open(x)
r = 1
fp = open(r)$ ruff --version
ruff 0.11.7
$ ruff check --isolated --select PTH123 t.py
t.py:4:6: PTH123 `open()` should be replaced by `Path.open()`
|
2 | def f() -> int:
3 | return 1
4 | fp = open(f())
| ^^^^ PTH123
5 | def g(x: int) -> None:
6 | open(x)
|
Found 1 error.This doesn't look like a regression of #12871. But I guess the fix (#13616) somehow didn't cover the case where the argument of open() is an int return value?
Version
0.11.7
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule