Skip to content

Commit db25c6f

Browse files
committed
[pathlib] Add group, owner methods on Windows
1 parent aeb9c4c commit db25c6f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ 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 exclude 3.13, but they always raise NotImplementedError.
249249
if sys.platform == "win32":
250+
if sys.version_info >= (3, 14):
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]
250254
if sys.version_info < (3, 13):
251255
def owner(self: Never) -> str: ... # type: ignore[misc]
252256
def group(self: Never) -> str: ... # type: ignore[misc]

0 commit comments

Comments
 (0)