Skip to content

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

Merged
charliermarsh merged 2 commits intoastral-sh:mainfrom
mikeleppane:fix(ASYNC101)/include-pathlib-Path-when-analyzing-open-calls
Jan 30, 2024
Merged

[flake8-async] Take pathlib.Path into account when analyzing async functions#9703
charliermarsh merged 2 commits intoastral-sh:mainfrom
mikeleppane:fix(ASYNC101)/include-pathlib-Path-when-analyzing-open-calls

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

@github-actions
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
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.

3 participants