You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASYNC101 Async functions should not call `open`, `time.sleep`, or `subprocess` methods
SIM115 Use context handler for opening files
PTH123 `open()` should be replaced by `Path.open()`
…c functions (#9703)
## Summary
This review contains a fix for
[ASYNC101](https://docs.astral.sh/ruff/rules/open-sleep-or-subprocess-in-async-function/)
(open-sleep-or-subprocess-in-async-function)
The problem is that ruff does not take open calls from pathlib.Path into
account in async functions. Path.open() call is still a blocking call.
In addition, PTH123 suggests to use pathlib.Path instead of os.open. So
this might create an additional confusion.
See: #6892
## Test Plan
```bash
cargo test
```
Let's ruff:
Result:
Let's apply fix for
PTH123
and ruff it again:Result:
success
Expected:
path.open
is also blocking asopen
for async.)path.open
works the same asopen
)The text was updated successfully, but these errors were encountered: