Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stdlib/pathlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class Path(PurePath):
# so it's safer to pretend they don't exist
def owner(self) -> str: ...
def group(self) -> str: ...

# This method does "exist" on Windows on <3.12, but always raises NotImplementedError
# On py312+, it works properly on Windows, as with all other platforms
if sys.platform != "win32" or sys.version_info >= (3, 12):
def is_mount(self) -> bool: ...

if sys.version_info >= (3, 9):
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/win32-py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ subprocess.STARTUPINFO.copy

# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/win32-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ subprocess.STARTUPINFO.copy

# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/win32-py37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ urllib.parse.parse_qsl

# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.WindowsPath.is_mount
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/win32-py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ subprocess.STARTUPINFO.copy

# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.WindowsPath.is_mount
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/win32-py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ subprocess.STARTUPINFO.copy

# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
3 changes: 0 additions & 3 deletions tests/stubtest_allowlists/win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,3 @@ tty
# pathlib functions that rely on modules that don't exist on Windows
pathlib.Path.owner
pathlib.Path.group
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount