-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[flake8-use-pathlib
] Fix PTH123
false positive when open
is passed a file descriptor from a function call
#17705
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
Conversation
…sed a file descriptor from a function call
|
Why the CI failed here? |
I re-ran it and it passed. I assume it's just a fluke :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great to me! Let's just add a few test cases for bytestrings, but otherwise this is good to go.
crates/ruff_linter/src/rules/flake8_use_pathlib/rules/replaceable_by_pathlib.rs
Show resolved
Hide resolved
* main: [red-knot] Use 'full' salsa backtrace output that includes durability and revisions (#17735) [red-knot] Initial support for protocol types (#17682) [red-knot] Computing a type ordering for two non-normalized types is meaningless (#17734) [red-knot] Include salsa backtrace in check and mdtest panic messages (#17732) [red-knot] Fix control flow for `assert` statements (#17702) [red-knot] Fix recording of negative visibility constraints (#17731) [red-knot] Update salsa (#17730) [red-knot] Support overloads for callable equivalence (#17698) [red-knot] Run py-fuzzer in CI to check for new panics (#17719) Upload red-knot binaries in CI on completion of linux tests (#17720) [`flake8-use-pathlib`] Fix `PTH123` false positive when `open` is passed a file descriptor from a function call (#17705)
…ssed a file descriptor (#17712) ## Summary Contains the same changes to the semantic type inference as #17705. Fixes #17694 <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? --> Snapshot tests. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
Summary
Includes minor changes to the semantic type inference to help detect the return type of function call.
Fixes #17691
Test Plan
Snapshot tests