#3426: os.path.abspath now returns unicode when its arg is unicode.

This commit is contained in:
Ezio Melotti 2010-02-20 08:09:39 +00:00
parent 61afd2694b
commit 4cc80ca921
8 changed files with 57 additions and 6 deletions

View file

@ -186,7 +186,11 @@ def walk(top, func, arg):
def abspath(path):
"""Return an absolute 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