Bug #1688564: document os.path.join's absolute path behavior in the docstring.
This commit is contained in:
parent
b7a837d81b
commit
da5f16ab19
|
@ -59,7 +59,9 @@ def isabs(s):
|
|||
# Join two (or more) paths.
|
||||
|
||||
def join(a, *p):
|
||||
"""Join two or more pathname components, inserting "\\" as needed"""
|
||||
"""Join two or more pathname components, inserting "\\" as needed.
|
||||
If any component is an absolute path, all previous path components
|
||||
will be discarded."""
|
||||
path = a
|
||||
for b in p:
|
||||
b_wins = 0 # set to 1 iff b makes path irrelevant
|
||||
|
|
|
@ -56,7 +56,9 @@ def isabs(s):
|
|||
# Insert a '/' unless the first part is empty or already ends in '/'.
|
||||
|
||||
def join(a, *p):
|
||||
"""Join two or more pathname components, inserting '/' as needed"""
|
||||
"""Join two or more pathname components, inserting '/' as needed.
|
||||
If any component is an absolute path, all previous path components
|
||||
will be discarded."""
|
||||
path = a
|
||||
for b in p:
|
||||
if b.startswith('/'):
|
||||
|
|
Loading…
Reference in New Issue