Skip to content

Conversation

@LaBatata101
Copy link
Contributor

Summary

Contains the same changes to the semantic type inference as #17705.

Fixes #17694

Test Plan

Snapshot tests.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Apr 30, 2025
@MichaReiser MichaReiser added the bug Something isn't working label Apr 30, 2025
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thank you. Lets remove the bytes string handling for now (sorry for that)

@LaBatata101 LaBatata101 changed the title [flake8-use-pathlib] Fix PTH104false positive when rename is passed a file descriptor or bytes string [flake8-use-pathlib] Fix PTH104false positive when rename is passed a file descriptor May 1, 2025
@ntBre
Copy link
Contributor

ntBre commented May 1, 2025

Oh thanks for opening the other PR! We were preparing for the release today and I just pushed similar changes here. I opted to leave the test cases, but otherwise they look very similar.

@ntBre ntBre merged commit 3353d07 into astral-sh:main May 1, 2025
34 checks passed
dcreager added a commit that referenced this pull request May 2, 2025
* main:
  [red-knot] Refactor: no mutability in call APIs (#17788)
  [red-knot] Fix panic for `tuple[x[y]]` string annotation (#17787)
  [red-knot] Implicit instance attributes in generic methods (#17769)
  doc: Add link to `check-typed-exception` from `S110` and `S112` (#17786)
  Fix module name in ASYNC110, 115, and 116 fixes (#17774)
  [red-knot] More informative hover-types for assignments (#17762)
  [syntax-errors] Use consistent message for bad starred expression usage. (#17772)
  red_knot_server: add auto-completion MVP
  Allow passing a virtual environment to `ruff analyze graph` (#17743)
  Bump 0.11.8 (#17766)
  [`flake8-use-pathlib`] Fix `PTH104`false positive when `rename` is passed a file descriptor (#17712)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PTH104 suggests Path.rename() which does not support file descriptors

4 participants