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
20 changes: 10 additions & 10 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,13 @@ def getpid() -> int: ...
def getppid() -> int: ...
def strerror(__code: int) -> str: ...
def umask(__mask: int) -> int: ...
@final
class uname_result(NamedTuple):
sysname: str
nodename: str
release: str
version: str
machine: str

if sys.platform != "win32":
def ctermid() -> str: ...
Expand Down Expand Up @@ -447,13 +454,6 @@ if sys.platform != "win32":
def getsid(__pid: int) -> int: ...
def setsid() -> None: ...
def setuid(__uid: int) -> None: ...
@final
class uname_result(NamedTuple):
sysname: str
nodename: str
release: str
version: str
machine: str
def uname() -> uname_result: ...

@overload
Expand All @@ -469,7 +469,7 @@ if sys.platform != "win32":

def putenv(__name: bytes | str, __value: bytes | str) -> None: ...

if sys.platform != "win32":
if sys.platform != "win32" or sys.version_info >= (3, 9):
def unsetenv(__name: bytes | str) -> None: ...

_Opener = Callable[[str, int], int]
Expand Down Expand Up @@ -563,7 +563,9 @@ else:
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...

def fstat(fd: int) -> stat_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def fsync(fd: FileDescriptorLike) -> None: ...
def isatty(__fd: int) -> bool: ...
def lseek(__fd: int, __position: int, __how: int) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = ..., *, dir_fd: int | None = ...) -> int: ...
def pipe() -> tuple[int, int]: ...
Expand All @@ -577,10 +579,8 @@ if sys.platform != "win32":
def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac
def fpathconf(__fd: int, __name: str | int) -> int: ...
def fstatvfs(__fd: int) -> statvfs_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def get_blocking(__fd: int) -> bool: ...
def set_blocking(__fd: int, __blocking: bool) -> None: ...
def isatty(__fd: int) -> bool: ...
def lockf(__fd: int, __command: int, __length: int) -> None: ...
def openpty() -> tuple[int, int]: ... # some flavors of Unix
if sys.platform != "darwin":
Expand Down
3 changes: 0 additions & 3 deletions tests/stubtest_allowlists/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ grp.struct_group.n_unnamed_fields
mimetypes.MimeTypes.read_windows_registry
os.ST_NOSUID
os.ST_RDONLY
(os|posix).uname_result.n_fields
(os|posix).uname_result.n_sequence_fields
(os|posix).uname_result.n_unnamed_fields
posix.chflags
posix.dup2
posix.lchflags
Expand Down
3 changes: 0 additions & 3 deletions tests/stubtest_allowlists/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ mimetypes.MimeTypes.read_windows_registry
(os|posix).sched_param.n_fields
(os|posix).sched_param.n_sequence_fields
(os|posix).sched_param.n_unnamed_fields
(os|posix).uname_result.n_fields
(os|posix).uname_result.n_sequence_fields
(os|posix).uname_result.n_unnamed_fields
(os|posix).waitid_result.n_fields
(os|posix).waitid_result.n_sequence_fields
(os|posix).waitid_result.n_unnamed_fields
Expand Down
3 changes: 3 additions & 0 deletions tests/stubtest_allowlists/py3_common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@ multiprocessing.synchronize.Semaphore.get_value
(os|posix).times_result.n_fields
(os|posix).times_result.n_sequence_fields
(os|posix).times_result.n_unnamed_fields
(os|posix).uname_result.n_fields
(os|posix).uname_result.n_sequence_fields
(os|posix).uname_result.n_unnamed_fields
pickle.Pickler.memo
pickle.Unpickler.memo
pipes.Template.makepipeline
Expand Down
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/win32-py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ asyncio.IocpProactor.sendto
asyncio.windows_events.IocpProactor.recvfrom
asyncio.windows_events.IocpProactor.sendto
msvcrt.GetErrorMode
os.unsetenv
socket.MsgFlag.MSG_ERRQUEUE
subprocess.STARTUPINFO.copy
14 changes: 0 additions & 14 deletions tests/stubtest_allowlists/win32-py39.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@

# Missing from stubs, found by removing --ignore-missing-stub
_winapi.CreateFileMapping
_winapi.MapViewOfFile
_winapi.OpenFileMapping
_winapi.VirtualQuerySize
asyncio.IocpProactor.recvfrom
asyncio.IocpProactor.sendto
asyncio.windows_events.IocpProactor.recvfrom
asyncio.windows_events.IocpProactor.sendto
os.unsetenv
socket.MsgFlag.MSG_ERRQUEUE
subprocess.STARTUPINFO.copy

# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping
_winapi.MapViewOfFile
Expand All @@ -21,6 +8,5 @@ asyncio.IocpProactor.recvfrom
asyncio.IocpProactor.sendto
asyncio.windows_events.IocpProactor.recvfrom
asyncio.windows_events.IocpProactor.sendto
os.unsetenv
socket.MsgFlag.MSG_ERRQUEUE
subprocess.STARTUPINFO.copy
3 changes: 0 additions & 3 deletions tests/stubtest_allowlists/win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ distutils.msvccompiler.MSVCCompiler.manifest_get_embed_info
distutils.msvccompiler.MSVCCompiler.manifest_setup_ldargs
distutils.msvccompiler.OldMSVCCompiler
msvcrt.SetErrorMode
os.ftruncate
os.get_handle_inheritable
os.isatty
os.set_handle_inheritable
os.statvfs_result
os.uname_result
signal.Signals.CTRL_BREAK_EVENT
signal.Signals.CTRL_C_EVENT
socket.MsgFlag.MSG_BCAST
Expand Down