commit | a7ffb663953bc84452af1e5f4089359d54e226b5 | [log] [tgz] |
---|---|---|
author | Steve Dower <steve.dower@microsoft.com> | Thu Oct 25 13:46:23 2018 -0400 |
committer | GitHub <noreply@github.com> | Thu Oct 25 13:46:23 2018 -0400 |
tree | 319d5278164792963cb3d5c581e04b3e9c23c251 | |
parent | 69a3f153a92fd8c86080e8da477ee50df18fc0d1 [diff] [blame] |
[3.7] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082)
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index f0e03a2..3c820b5 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py
@@ -523,8 +523,8 @@ 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