File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,7 +517,9 @@ def normpath(path):
517517
518518except ImportError : # not running on Windows - mock up something sensible
519519 def _strip_dots_and_spaces (path ):
520- # As the Windows path normalization does.
520+ # Imitate the trailing dot and space stripping performed by the
521+ # Windows path normalization. This is a best effort, not a
522+ # specification.
521523 if isinstance (path , bytes ):
522524 sep = b'\\ '
523525 dot = b'.'
Original file line number Diff line number Diff line change @@ -1213,6 +1213,7 @@ def test_expanduser(self):
12131213 def test_abspath_dots_and_spaces (self ):
12141214 # gh-85681: trailing dots and spaces are stripped from the last
12151215 # component, and a single trailing dot from other components.
1216+ # This is the observed Windows behavior, not a specification.
12161217 tester ('ntpath.abspath("C:/spam. . .")' , "C:\\ spam" )
12171218 tester ('ntpath.abspath("C:/spam.")' , "C:\\ spam" )
12181219 tester ('ntpath.abspath("C:/spam ")' , "C:\\ spam" )
You can’t perform that action at this time.
0 commit comments