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
(cherry picked from commit 95492032c4)

Co-authored-by: Makdon <makdon@makdon.me>
This commit is contained in:
Miss Islington (bot) 2019-06-13 07:12:49 -07:00 committed by GitHub
parent b4f5b21253
commit ec3839a215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -87,9 +87,10 @@ the :mod:`glob` module.)
.. function:: commonpath(paths) .. function:: commonpath(paths)
Return the longest common sub-path of each pathname in the sequence Return the longest common sub-path of each pathname in the sequence
*paths*. Raise :exc:`ValueError` if *paths* contains both absolute and relative *paths*. Raise :exc:`ValueError` if *paths* contain both absolute
pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this and relative pathnames, the *paths* are on the different drives or
returns a valid path. if *paths* is empty. Unlike :func:`commonprefix`, this returns a
valid path.
.. availability:: Unix, Windows. .. availability:: Unix, Windows.