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 @@ -545,8 +545,8 @@ def _abspath_fallback(path):
545545 def abspath (path ):
546546 """Return the absolute version of a path."""
547547 try :
548- return _getfullpathname (path )
549- except OSError :
548+ return normpath ( _getfullpathname (path ) )
549+ except ( OSError , ValueError ) :
550550 return _abspath_fallback (path )
551551
552552# realpath is a no-op on systems without islink support
Original file line number Diff line number Diff line change @@ -307,6 +307,8 @@ def test_abspath(self):
307307 tester ('ntpath.abspath("")' , cwd_dir )
308308 tester ('ntpath.abspath(" ")' , cwd_dir + "\\ " )
309309 tester ('ntpath.abspath("?")' , cwd_dir + "\\ ?" )
310+ drive , _ = ntpath .splitdrive (cwd_dir )
311+ tester ('ntpath.abspath("/abc/")' , drive + "\\ abc" )
310312 except ImportError :
311313 self .skipTest ('nt module not available' )
312314
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