diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-20 09:16:04 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-20 09:16:04 (GMT) |
| commit | 502f8eb50b2e2968534da6cdfafb563615cc5798 (patch) | |
| tree | beed6f693b70137cd08d3f5e05d0d0532a8051f0 /Lib/ntpath.py | |
| parent | aaa210e2fdc96030439bf694fae1994cac495565 (diff) | |
| download | cpython-502f8eb50b2e2968534da6cdfafb563615cc5798.zip cpython-502f8eb50b2e2968534da6cdfafb563615cc5798.tar.gz cpython-502f8eb50b2e2968534da6cdfafb563615cc5798.tar.bz2 | |
Merged revisions 78247 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78247 | ezio.melotti | 2010-02-20 10:09:39 +0200 (Sat, 20 Feb 2010) | 1 line
#3426: os.path.abspath now returns unicode when its arg is unicode.
........
Diffstat (limited to 'Lib/ntpath.py')
| -rw-r--r-- | Lib/ntpath.py | 8 |
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) |
