Skip to content

Commit 5876678

Browse files
committed
Update os on Windows, Python3.11+
1 parent 6dfa285 commit 5876678

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

stdlib/os/__init__.pyi

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,17 @@ class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, flo
349349
@property
350350
def st_rdev(self) -> int: ... # type of device if an inode device
351351
if sys.platform != "linux":
352-
# These properties are available on MacOS, but not on Windows or Ubuntu.
353352
# On other Unix systems (such as FreeBSD), the following attributes may be
354353
# available (but may be only filled out if root tries to use them):
355354
@property
356355
def st_gen(self) -> int: ... # file generation number
357-
@property
358-
def st_birthtime(self) -> int: ... # time of file creation
356+
357+
if (sys.version_info >= (3, 12) and sys.platform == "win32") or sys.platform != "linux":
358+
@property
359+
def st_birthtime(self) -> int: ... # time of file creation in seconds
360+
if sys.version_info >= (3, 12) and sys.platform == "win32":
361+
@property
362+
def st_birthtime_ns(self) -> int: ... # time of file creation in nanoseconds
359363
if sys.platform == "darwin":
360364
@property
361365
def st_flags(self) -> int: ... # user defined flags for file
@@ -616,13 +620,15 @@ def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | N
616620
def pipe() -> tuple[int, int]: ...
617621
def read(__fd: int, __length: int) -> bytes: ...
618622

623+
if sys.version_info >= (3, 12) or sys.platform != "win32":
624+
def get_blocking(__fd: int) -> bool: ...
625+
def set_blocking(__fd: int, __blocking: bool) -> None: ...
626+
619627
if sys.platform != "win32":
620628
def fchmod(fd: int, mode: int) -> None: ...
621629
def fchown(fd: int, uid: int, gid: int) -> None: ...
622630
def fpathconf(__fd: int, __name: str | int) -> int: ...
623631
def fstatvfs(__fd: int) -> statvfs_result: ...
624-
def get_blocking(__fd: int) -> bool: ...
625-
def set_blocking(__fd: int, __blocking: bool) -> None: ...
626632
def lockf(__fd: int, __command: int, __length: int) -> None: ...
627633
def openpty() -> tuple[int, int]: ... # some flavors of Unix
628634
if sys.platform != "darwin":
@@ -1044,3 +1050,8 @@ if sys.version_info >= (3, 9):
10441050

10451051
if sys.platform == "linux":
10461052
def pidfd_open(pid: int, flags: int = ...) -> int: ...
1053+
1054+
if sys.version_info >= (3, 12) and sys.platform == "win32":
1055+
def listdrives() -> list[str]: ...
1056+
def listmounts(str) -> list[str]: ...
1057+
def listvolumes() -> list[str]: ...

tests/stubtest_allowlists/win32-py312.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ asyncio.windows_events.IocpProactor.finish_socket_func
55
asyncio.windows_events.IocpProactor.recvfrom_into
66
msvcrt.GetErrorMode
77
ntpath.isdir
8-
os.get_blocking
9-
os.listdrives
10-
os.listmounts
11-
os.listvolumes
12-
os.path.isdir
13-
os.set_blocking
14-
os.stat_result.st_birthtime
15-
os.stat_result.st_birthtime_ns

0 commit comments

Comments
 (0)