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):
523
523
def abspath (path ):
524
524
"""Return the absolute version of a path."""
525
525
try :
526
- return _getfullpathname (path )
527
- except OSError :
526
+ return normpath ( _getfullpathname (path ) )
527
+ except ( OSError , ValueError ) :
528
528
return _abspath_fallback (path )
529
529
530
530
# 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):
284
284
tester ('ntpath.abspath("")' , cwd_dir )
285
285
tester ('ntpath.abspath(" ")' , cwd_dir + "\\ " )
286
286
tester ('ntpath.abspath("?")' , cwd_dir + "\\ ?" )
287
+ drive , _ = ntpath .splitdrive (cwd_dir )
288
+ tester ('ntpath.abspath("/abc/")' , drive + "\\ abc" )
287
289
288
290
def test_relpath (self ):
289
291
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