Skip to content

PTH201 should check all subclasses of PurePath #19437

@dscorbett

Description

@dscorbett

Summary

path-constructor-current-directory (PTH201) checks PurePath and Path. It should also check the other standard-library subclasses of PurePath. Example:

from importlib.metadata import PackagePath
from pathlib import PosixPath, PurePosixPath, PureWindowsPath, WindowsPath
PackagePath(".")
PosixPath(".")
PurePosixPath(".")
PureWindowsPath(".")
WindowsPath(".")

Version

ruff 0.12.4 (ee2759b 2025-07-17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing 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