Skip to content

PTH116 suggests Path.stat() which does not support file descriptors #17693

Closed
@sbrudenell

Description

@sbrudenell

Summary

import os
os.stat(1)
$ ruff --version
ruff 0.11.7
$ ruff check --isolated --select PTH116 t.py
t.py:2:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`
  |
1 | import os
2 | os.stat(1)
  | ^^^^^^^ PTH116
  |

Found 1 error.

Path.stat() has no support for file descriptors.

Related: #12871, #7620

Version

0.11.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions