Skip to content

Commit c82ad37

Browse files
authored
[pathlib] Add owner, group methods on Windows (#14536)
1 parent 5a7bac0 commit c82ad37

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stdlib/@tests/stubtest_allowlists/win32-py314.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# ====================================================================
44

55
compression.zlib.ZLIBNG_VERSION
6-
pathlib.Path.group
7-
pathlib.Path.owner
86
zlib.ZLIBNG_VERSION
97

108

stdlib/pathlib/__init__.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,13 @@ class Path(PurePath):
245245
self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None
246246
) -> IO[Any]: ...
247247

248-
# These methods do "exist" on Windows on <3.13, but they always raise NotImplementedError.
248+
# These methods do "exist" on Windows, but they always raise NotImplementedError.
249249
if sys.platform == "win32":
250-
if sys.version_info < (3, 13):
250+
if sys.version_info >= (3, 13):
251+
# raises UnsupportedOperation:
252+
def owner(self: Never, *, follow_symlinks: bool = True) -> str: ... # type: ignore[misc]
253+
def group(self: Never, *, follow_symlinks: bool = True) -> str: ... # type: ignore[misc]
254+
else:
251255
def owner(self: Never) -> str: ... # type: ignore[misc]
252256
def group(self: Never) -> str: ... # type: ignore[misc]
253257
else:

0 commit comments

Comments
 (0)