mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
#3426: os.path.abspath now returns unicode when its arg is unicode.
This commit is contained in:
parent
61afd2694b
commit
4cc80ca921
8 changed files with 57 additions and 6 deletions
|
@ -146,7 +146,11 @@ def normpath(path):
|
|||
def abspath(path):
|
||||
"""Return the absolute version of a path"""
|
||||
if not isabs(path):
|
||||
path = join(os.getcwd(), path)
|
||||
if isinstance(path, unicode):
|
||||
cwd = os.getcwdu()
|
||||
else:
|
||||
cwd = os.getcwd()
|
||||
path = join(cwd, path)
|
||||
return normpath(path)
|
||||
|
||||
# realpath is a no-op on systems without islink support
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue