pathlib: is_mount() is implemented on Windows on py312+ (#10257)

This commit is contained in:
Alex Waygood
2023-06-04 20:09:06 +01:00
committed by GitHub
parent 7df870f452
commit c3791d024a
7 changed files with 9 additions and 3 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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