Skip to content

fix for os.path.splitroot on 3.13 #13034

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
wants to merge 6 commits into from
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
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/darwin-py313.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# new in py313
posixpath.splitroot

# Depends on HAVE_NCURSESW and how we install CPython,
# should be removed when 3.13 will be officially released:
_?curses.unget_wch
Expand Down
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/linux-py313.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# TODO: triage these (new in py313)
posixpath.splitroot
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# TODO: triage these new errors
_tkinter.create
os.path.splitroot
tkinter.Misc.after_info
tkinter.Misc.busy
tkinter.Misc.busy_cget
Expand Down
10 changes: 8 additions & 2 deletions stdlib/ntpath.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from _typeshed import AnyOrLiteralStr, BytesPath, StrOrBytesPath, StrPath
from genericpath import (
commonprefix as commonprefix,
exists as exists,
Expand Down Expand Up @@ -46,7 +46,7 @@ from typing import AnyStr, overload
from typing_extensions import LiteralString

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

Expand Down Expand Up @@ -124,3 +124,9 @@ else:

if sys.version_info >= (3, 13):
def isreserved(path: StrOrBytesPath) -> bool: ...

if sys.version_info >= (3, 12):
@overload
def splitroot(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr, AnyOrLiteralStr]: ...
@overload
def splitroot(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr, AnyStr]: ...
8 changes: 8 additions & 0 deletions stdlib/posixpath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ def lexists(path: FileDescriptorOrPath) -> bool: ...

if sys.version_info >= (3, 12):
def isjunction(path: StrOrBytesPath) -> bool: ...

if sys.version_info >= (3, 13) and sys.platform != "win32":
@overload
def splitroot(path: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr, AnyOrLiteralStr]: ...
@overload
def splitroot(path: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr, AnyStr]: ...

elif sys.version_info >= (3, 12):
@overload
def splitroot(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr, AnyOrLiteralStr]: ...
@overload
Expand Down
Loading