Skip to content

Update os.path.isdir on Windows Python3.12+ #10751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
10 changes: 8 additions & 2 deletions stdlib/ntpath.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import sys
from _typeshed import BytesPath, StrPath
from _typeshed import BytesPath, FileDescriptorOrPath, StrPath
from genericpath import (
commonprefix as commonprefix,
exists as exists,
getatime as getatime,
getctime as getctime,
getmtime as getmtime,
getsize as getsize,
isdir as isdir,
isfile as isfile,
samefile as samefile,
sameopenfile as sameopenfile,
Expand Down Expand Up @@ -45,6 +44,13 @@ from posixpath import (

if sys.version_info >= (3, 12):
from posixpath import isjunction as isjunction, splitroot as splitroot

if sys.version_info >= (3, 12) and sys.platform == "win32":
def isdir(path: FileDescriptorOrPath) -> bool: ...

else:
def isdir(s: FileDescriptorOrPath) -> bool: ...

from typing import AnyStr, overload
from typing_extensions import LiteralString

Expand Down
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/win32-py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ asyncio.IocpProactor.recvfrom_into
asyncio.windows_events.IocpProactor.finish_socket_func
asyncio.windows_events.IocpProactor.recvfrom_into
msvcrt.GetErrorMode
ntpath.isdir
os.path.isdir