[flake8-use-pathlib] Fix PTH123 false positive when open is passed a file descriptor from a function call#17705
Merged
ntBre merged 3 commits intoastral-sh:mainfrom Apr 29, 2025
Merged
Conversation
…sed a file descriptor from a function call
Contributor
|
This was referenced Apr 29, 2025
Contributor
Author
|
Why the CI failed here? |
Member
I re-ran it and it passed. I assume it's just a fluke :-) |
ntBre
approved these changes
Apr 29, 2025
Contributor
ntBre
left a comment
There was a problem hiding this comment.
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
dcreager
added a commit
that referenced
this pull request
Apr 30, 2025
* 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)
ntBre
added a commit
that referenced
this pull request
May 1, 2025
…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 <[email protected]> Co-authored-by: Brent Westbrook <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Includes minor changes to the semantic type inference to help detect the return type of function call.
Fixes #17691
Test Plan
Snapshot tests