From: Georg Brandl Date: Thu, 23 Aug 2007 21:27:57 +0000 (+0000) Subject: Bug #1688564: document os.path.join's absolute path behavior in the docstring. X-Git-Tag: v2.6a1~1449 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da5f16ab19db54f5801489b8d0caadea793ec187;p=python Bug #1688564: document os.path.join's absolute path behavior in the docstring. --- diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 99d7a4a8cd..06b2293293 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -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 diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 6f15d48f12..6d4a9e2111 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -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('/'):