Skip to content
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

[flake8-async] Take pathlib.Path into account when analyzing async functions #9703

Conversation

mikeleppane
Copy link
Contributor

Summary

This review contains a fix for ASYNC101 (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

cargo test

Copy link
Contributor

github-actions bot commented Jan 30, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@charliermarsh charliermarsh added the bug Something isn't working label Jan 30, 2024
@charliermarsh charliermarsh changed the title [flake8-async] Take pathlib.Path into account when analyzing open calls in async functions [flake8-async] Take pathlib.Path into account when analyzing async functions Jan 30, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) January 30, 2024 17:38
@charliermarsh charliermarsh merged commit 79f0522 into astral-sh:main Jan 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants