summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-23 21:27:57 (GMT)
committerGeorg Brandl <georg@python.org>2007-08-23 21:27:57 (GMT)
commitda5f16ab19db54f5801489b8d0caadea793ec187 (patch)
treee5fa7ac053518fb726a95eee89784bd78d7afb61
parentb7a837d81b9464298c6cd5b375da0934d35738c4 (diff)
downloadcpython-da5f16ab19db54f5801489b8d0caadea793ec187.zip
cpython-da5f16ab19db54f5801489b8d0caadea793ec187.tar.gz
cpython-da5f16ab19db54f5801489b8d0caadea793ec187.tar.bz2
Bug #1688564: document os.path.join's absolute path behavior in the docstring.
-rw-r--r--Lib/ntpath.py4
-rw-r--r--Lib/posixpath.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 99d7a4a..06b2293 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 6f15d48..6d4a9e2 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('/'):