[pathlib] Add owner, group methods on Windows (#14536)

This commit is contained in:
Semyon Moroz
2025-08-07 11:51:17 +00:00
committed by GitHub
parent 5a7bac0e97
commit c82ad37425
2 changed files with 6 additions and 4 deletions
@@ -3,8 +3,6 @@
# ====================================================================
compression.zlib.ZLIBNG_VERSION
pathlib.Path.group
pathlib.Path.owner
zlib.ZLIBNG_VERSION
+6 -2
View File
@@ -245,9 +245,13 @@ class Path(PurePath):
self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None
) -> IO[Any]: ...
# These methods do "exist" on Windows on <3.13, but they always raise NotImplementedError.
# These methods do "exist" on Windows, but they always raise NotImplementedError.
if sys.platform == "win32":
if sys.version_info < (3, 13):
if sys.version_info >= (3, 13):
# raises UnsupportedOperation:
def owner(self: Never, *, follow_symlinks: bool = True) -> str: ... # type: ignore[misc]
def group(self: Never, *, follow_symlinks: bool = True) -> str: ... # type: ignore[misc]
else:
def owner(self: Never) -> str: ... # type: ignore[misc]
def group(self: Never) -> str: ... # type: ignore[misc]
else: