Put shutil.chown back on Windows (#7446)

See #7384 and https://github.com/python/typeshed/pull/7443#issuecomment-1060071944 (thanks @AlexWaygood for diagnosing).
This commit is contained in:
Jelle Zijlstra
2022-03-06 16:27:24 -08:00
committed by GitHub
parent addce5c067
commit 2fb9c35ff9
2 changed files with 11 additions and 14 deletions

View File

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

View File

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