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

PTH123 suggests Path.open() which does not support file descriptors #12871

Open
sbrudenell opened this issue Aug 13, 2024 · 1 comment
Open
Labels
bug Something isn't working rule Implementing or modifying a lint rule

Comments

@sbrudenell
Copy link

fp = open(2)
$ ruff --version
ruff 0.5.7
$ ruff check --isolated --select PTH123 t.py
t.py:1:6: PTH123 `open()` should be replaced by `Path.open()`
  |
1 | fp = open(2)
  |      ^^^^ PTH123
  |

Found 1 error.

Path.open() doesn't seem to have a variant which supports a file descriptor.

This is essentially similar to #7620

@MichaReiser MichaReiser added bug Something isn't working rule Implementing or modifying a lint rule labels Aug 14, 2024
@MichaReiser
Copy link
Member

Makes sense. Thanks

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

No branches or pull requests

2 participants