summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.path.rst
diff options
context:
space:
mode:
authorMakdon <makdon@makdon.me>2019-06-13 13:59:49 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-13 13:59:49 (GMT)
commit95492032c48fef20b9c7076a23fe7e46927a4688 (patch)
treeea5ce95527b7b33553e3d07af9450d2e22389b71 /Doc/library/os.path.rst
parent6d22cc8e90ccb1e1965b1a4bc79456e2cc1e5a3e (diff)
downloadcpython-95492032c48fef20b9c7076a23fe7e46927a4688.zip
cpython-95492032c48fef20b9c7076a23fe7e46927a4688.tar.gz
cpython-95492032c48fef20b9c7076a23fe7e46927a4688.tar.bz2
bpo-6689: os.path.commonpath raises ValueError for different drives isn't documented (GH-14045)
It would raise ValueError("Paths don't have the same drive") if the paths on different drivers, which is not documented. os.path.commonpath raises ValueError when the *paths* are in different drivers, but it is not documented. Update the document according @Windsooon 's suggestion. It actually raise ValueError according line 355 of [test of path](https://github.com/python/cpython/blob/master/Lib/test/test_ntpath.py) https://bugs.python.org/issue6689
Diffstat (limited to 'Doc/library/os.path.rst')
-rw-r--r--Doc/library/os.path.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 8e7ee8b..a673b81 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -87,9 +87,10 @@ the :mod:`glob` module.)
.. function:: commonpath(paths)
Return the longest common sub-path of each pathname in the sequence
- *paths*. Raise :exc:`ValueError` if *paths* contains both absolute and relative
- pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this
- returns a valid path.
+ *paths*. Raise :exc:`ValueError` if *paths* contain both absolute
+ and relative pathnames, the *paths* are on the different drives or
+ if *paths* is empty. Unlike :func:`commonprefix`, this returns a
+ valid path.
.. availability:: Unix, Windows.