diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 55c964fbdcf9..030f16cd99b7 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -101,17 +101,17 @@ class _ntuple_diskusage(NamedTuple): def disk_usage(path: int | StrOrBytesPath) -> _ntuple_diskusage: ... -if sys.platform != "win32": - # while chown can be imported on Windows it doesn't actually work - # see https://bugs.python.org/issue33140 - @overload - def chown(path: StrOrBytesPath, user: str | int, group: None = ...) -> None: ... - @overload - def chown(path: StrOrBytesPath, user: None = ..., *, group: str | int) -> None: ... - @overload - def chown(path: StrOrBytesPath, user: None, group: str | int) -> None: ... - @overload - def chown(path: StrOrBytesPath, user: str | int, group: str | int) -> None: ... +# While chown can be imported on Windows, it doesn't actually work; +# see https://bugs.python.org/issue33140. We keep it here because it's +# in __all__. +@overload +def chown(path: StrOrBytesPath, user: str | int, group: None = ...) -> None: ... +@overload +def chown(path: StrOrBytesPath, user: None = ..., *, group: str | int) -> None: ... +@overload +def chown(path: StrOrBytesPath, user: None, group: str | int) -> None: ... +@overload +def chown(path: StrOrBytesPath, user: str | int, group: str | int) -> None: ... if sys.version_info >= (3, 8): @overload diff --git a/tests/stubtest_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index f7d68a3a0fd2..ec7c2a84c94d 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -75,6 +75,3 @@ ssl.SSLSocket.recvmsg ssl.SSLSocket.recvmsg_into ssl.SSLSocket.sendmsg winreg.HKEYType.handle - -# exist but do not work on Windows -shutil.chown