Pathlib: preserve trailing slash

Experimentally, the trailing slash on Windows seems to have the same effect (i.e. forcing resolution as a directory):

>>> os.stat('c:/windows')
os.stat_result(st_mode=16895, st_ino=1407374883832841, st_dev=10709685299559133658, st_nlink=1, st_uid=0, st_gid=0, st_size=16384, st_atime=1701822404, st_mtime=1700700385, st_ctime=1575709424)
>>> os.stat('c:/windows/')
os.stat_result(st_mode=16895, st_ino=1407374883832841, st_dev=10709685299559133658, st_nlink=1, st_uid=0, st_gid=0, st_size=16384, st_atime=1701822404, st_mtime=1700700385, st_ctime=1575709424)
>>> os.stat('c:/windows/notepad.exe')
os.stat_result(st_mode=33279, st_ino=562949954686276, st_dev=10709685299559133658, st_nlink=3, st_uid=0, st_gid=0, st_size=201216, st_atime=1701822285, st_mtime=1700340994, st_ctime=1700340994)
>>> os.stat('c:/windows/notepad.exe/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'c:/windows/notepad.exe/'
1 Like