Improve pathlib stubs (#7181)

This commit is contained in:
Alex Waygood
2022-02-13 02:42:04 +00:00
committed by GitHub
parent 2ce1844905
commit 03dbe2206c
7 changed files with 42 additions and 6 deletions

View File

@@ -6,6 +6,11 @@ sqlite3.Connection.load_extension
sqlite3.dbapi2.Connection.enable_load_extension
sqlite3.dbapi2.Connection.load_extension
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.is_mount
pathlib.Path.is_mount
# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping
_winapi.MapViewOfFile

View File

@@ -7,6 +7,11 @@ cgi.parse
urllib.parse.parse_qs
urllib.parse.parse_qsl
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
hashlib.scrypt
os.startfile

View File

@@ -8,6 +8,13 @@ cgi.parse_multipart
urllib.parse.parse_qs
urllib.parse.parse_qsl
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
os.startfile
# Exists at runtime, but missing from stubs

View File

@@ -1,3 +1,10 @@
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping
_winapi.MapViewOfFile

View File

@@ -1,3 +1,8 @@
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping
_winapi.MapViewOfFile

View File

@@ -56,6 +56,10 @@ curses.textpad
pty
tty
# pathlib functions that rely on modules that don't exist on Windows
pathlib.Path.owner
pathlib.Path.group
# Exists at runtime, but missing from stubs
_msi.MSIError
asyncio.windows_utils.Popen