[Python-checkins] r57353 - python/trunk/Lib/ntpath.py python/trunk/Lib/posixpath.py

georg.brandl python-checkins at python.org
Thu Aug 23 23:27:58 CEST 2007


Author: georg.brandl
Date: Thu Aug 23 23:27:57 2007
New Revision: 57353

Modified:
   python/trunk/Lib/ntpath.py
   python/trunk/Lib/posixpath.py
Log:
Bug #1688564: document os.path.join's absolute path behavior in the docstring.


Modified: python/trunk/Lib/ntpath.py
==============================================================================
--- python/trunk/Lib/ntpath.py	(original)
+++ python/trunk/Lib/ntpath.py	Thu Aug 23 23:27:57 2007
@@ -59,7 +59,9 @@
 # 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

Modified: python/trunk/Lib/posixpath.py
==============================================================================
--- python/trunk/Lib/posixpath.py	(original)
+++ python/trunk/Lib/posixpath.py	Thu Aug 23 23:27:57 2007
@@ -56,7 +56,9 @@
 # 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('/'):


More information about the Python-checkins mailing list