File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -523,8 +523,8 @@ def _abspath_fallback(path):
523523 def abspath (path ):
524524 """Return the absolute version of a path."""
525525 try :
526- return _getfullpathname (path )
527- except OSError :
526+ return normpath ( _getfullpathname (path ) )
527+ except ( OSError , ValueError ) :
528528 return _abspath_fallback (path )
529529
530530# realpath is a no-op on systems without islink support
Original file line number Diff line number Diff line change @@ -284,6 +284,8 @@ def test_abspath(self):
284284 tester ('ntpath.abspath("")' , cwd_dir )
285285 tester ('ntpath.abspath(" ")' , cwd_dir + "\\ " )
286286 tester ('ntpath.abspath("?")' , cwd_dir + "\\ ?" )
287+ drive , _ = ntpath .splitdrive (cwd_dir )
288+ tester ('ntpath.abspath("/abc/")' , drive + "\\ abc" )
287289
288290 def test_relpath (self ):
289291 tester ('ntpath.relpath("a")' , 'a' )
Original file line number Diff line number Diff line change 1+ Fix ``ntpath.abspath `` regression where it didn't remove a trailing
2+ separator on Windows. Patch by Tim Graham.
You can’t perform that action at this time.
0 commit comments