summaryrefslogtreecommitdiffstats
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-02-20 08:09:39 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-02-20 08:09:39 (GMT)
commit4cc80ca921b4f6bce11bd7eec8bc6b561aa9f524 (patch)
tree9951e02d8dec6e305ab5fa184b93c9d0e534eea5 /Lib/ntpath.py
parent61afd2694bf6bff8c65a392aaf27c575d92b7eb9 (diff)
downloadcpython-4cc80ca921b4f6bce11bd7eec8bc6b561aa9f524.zip
cpython-4cc80ca921b4f6bce11bd7eec8bc6b561aa9f524.tar.gz
cpython-4cc80ca921b4f6bce11bd7eec8bc6b561aa9f524.tar.bz2
#3426: os.path.abspath now returns unicode when its arg is unicode.
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 02d8584..a124dfd 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -449,7 +449,11 @@ except ImportError: # not running on Windows - mock up something sensible
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)
else: # use native Windows method on Windows
@@ -461,6 +465,8 @@ else: # use native Windows method on Windows
path = _getfullpathname(path)
except WindowsError:
pass # Bad path - return unchanged.
+ elif isinstance(path, unicode):
+ path = os.getcwdu()
else:
path = os.getcwd()
return normpath(path)