mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)
This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
This commit is contained in:
parent
b8ddf7e794
commit
d4e64cd4b0
8 changed files with 114 additions and 42 deletions
|
@ -551,7 +551,7 @@ else: # use native Windows method on Windows
|
|||
def abspath(path):
|
||||
"""Return the absolute version of a path."""
|
||||
try:
|
||||
return normpath(_getfullpathname(path))
|
||||
return _getfullpathname(normpath(path))
|
||||
except (OSError, ValueError):
|
||||
return _abspath_fallback(path)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue