Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc260a9

Browse files
committed
Closes #15414: Merge with 3.4
2 parents 439da84 + a13dab4 commit fc260a9

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

Doc/library/os.path.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,22 @@ the :mod:`glob` module.)
206206
Support for detecting non-root mount points on Windows.
207207

208208

209-
.. function:: join(path1[, path2[, ...]])
210-
211-
Join one or more path components intelligently. If any component is an absolute
212-
path, all previous components (on Windows, including the previous drive letter,
213-
if there was one) are thrown away, and joining continues. The return value is
214-
the concatenation of *path1*, and optionally *path2*, etc., with exactly one
215-
directory separator (``os.sep``) following each non-empty part except the last.
216-
(This means that an empty last part will result in a path that ends with a
217-
separator.) Note that on Windows, since there is a current directory for
218-
each drive, ``os.path.join("c:", "foo")`` represents a path relative to the
219-
current directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
209+
.. function:: join(path, *paths)
210+
211+
Join one or more path components intelligently. The return value is the
212+
concatenation of *path* and any members of *\*paths* with exactly one
213+
directory separator (``os.sep``) following each non-empty part except the
214+
last, meaning that the result will only end in a separator if the last
215+
part is empty. If a component is an absolute path, all previous
216+
components are thrown away and joining continues from the absolute path
217+
component.
218+
219+
On Windows, the drive letter is not reset when an absolute path component
220+
(e.g., ``r'\foo'``) is encountered. If a component contains a drive
221+
letter, all previous components are thrown away and the drive letter is
222+
reset. Note that since there is a current directory for each drive,
223+
``os.path.join("c:", "foo")`` represents a path relative to the current
224+
directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
220225

221226

222227
.. function:: normcase(path)

0 commit comments

Comments
 (0)