def abspath(path):
"""Return the absolute version of a path."""
try:
- return _getfullpathname(path)
- except OSError:
+ return normpath(_getfullpathname(path))
+ except (OSError, ValueError):
return _abspath_fallback(path)
# realpath is a no-op on systems without islink support
tester('ntpath.abspath("")', cwd_dir)
tester('ntpath.abspath(" ")', cwd_dir + "\\ ")
tester('ntpath.abspath("?")', cwd_dir + "\\?")
+ drive, _ = ntpath.splitdrive(cwd_dir)
+ tester('ntpath.abspath("/abc/")', drive + "\\abc")
except ImportError:
self.skipTest('nt module not available')