@@ -47,7 +47,7 @@ def _get_bothseps(path):
4747 LOCALE_NAME_INVARIANT as _LOCALE_NAME_INVARIANT ,
4848 LCMAP_LOWERCASE as _LCMAP_LOWERCASE )
4949
50- def normcase (s ):
50+ def normcase (s , / ):
5151 """Normalize case of pathname.
5252
5353 Makes all characters lowercase and all slashes into backslashes.
@@ -66,7 +66,7 @@ def normcase(s):
6666 _LCMAP_LOWERCASE ,
6767 s .replace ('/' , '\\ ' ))
6868except ImportError :
69- def normcase (s ):
69+ def normcase (s , / ):
7070 """Normalize case of pathname.
7171
7272 Makes all characters lowercase and all slashes into backslashes.
@@ -77,7 +77,7 @@ def normcase(s):
7777 return s .replace ('/' , '\\ ' ).lower ()
7878
7979
80- def isabs (s ):
80+ def isabs (s , / ):
8181 """Test whether a path is absolute"""
8282 s = os .fspath (s )
8383 if isinstance (s , bytes ):
@@ -96,7 +96,7 @@ def isabs(s):
9696
9797
9898# Join two (or more) paths.
99- def join (path , * paths ):
99+ def join (path , / , * paths ):
100100 path = os .fspath (path )
101101 if isinstance (path , bytes ):
102102 sep = b'\\ '
@@ -143,7 +143,7 @@ def join(path, *paths):
143143# Split a path in a drive specification (a drive letter followed by a
144144# colon) and the path specification.
145145# It is always true that drivespec + pathspec == p
146- def splitdrive (p ):
146+ def splitdrive (p , / ):
147147 """Split a pathname into drive/UNC sharepoint and relative path specifiers.
148148 Returns a 2-tuple (drive_or_unc, path); either part may be empty.
149149
@@ -169,7 +169,7 @@ def splitdrive(p):
169169try :
170170 from nt import _path_splitroot_ex as splitroot
171171except ImportError :
172- def splitroot (p ):
172+ def splitroot (p , / ):
173173 """Split a pathname into drive, root and tail.
174174
175175 The tail contains anything after the root."""
@@ -219,7 +219,7 @@ def splitroot(p):
219219# join(head, tail) == p holds.
220220# The resulting head won't end in '/' unless it is the root.
221221
222- def split (p ):
222+ def split (p , / ):
223223 """Split a pathname.
224224
225225 Return tuple (head, tail) where tail is everything after the final slash.
@@ -240,7 +240,7 @@ def split(p):
240240# pathname component; the root is everything before that.
241241# It is always true that root + ext == p.
242242
243- def splitext (p ):
243+ def splitext (p , / ):
244244 p = os .fspath (p )
245245 if isinstance (p , bytes ):
246246 return genericpath ._splitext (p , b'\\ ' , b'/' , b'.' )
@@ -251,14 +251,14 @@ def splitext(p):
251251
252252# Return the tail (basename) part of a path.
253253
254- def basename (p ):
254+ def basename (p , / ):
255255 """Returns the final component of a pathname"""
256256 return split (p )[1 ]
257257
258258
259259# Return the head (dirname) part of a path.
260260
261- def dirname (p ):
261+ def dirname (p , / ):
262262 """Returns the directory component of a pathname"""
263263 return split (p )[0 ]
264264
@@ -601,7 +601,7 @@ def abspath(path):
601601 from nt import _findfirstfile , _getfinalpathname , readlink as _nt_readlink
602602except ImportError :
603603 # realpath is a no-op on systems without _getfinalpathname support.
604- def realpath (path , * , strict = False ):
604+ def realpath (path , / , * , strict = False ):
605605 return abspath (path )
606606else :
607607 def _readlink_deep (path , ignored_error = OSError ):
@@ -702,7 +702,7 @@ def _getfinalpathname_nonstrict(path, ignored_error=OSError):
702702 tail = join (name , tail ) if tail else name
703703 return tail
704704
705- def realpath (path , * , strict = False ):
705+ def realpath (path , / , * , strict = False ):
706706 path = normpath (path )
707707 if isinstance (path , bytes ):
708708 prefix = b'\\ \\ ?\\ '
0 commit comments