Title: docs: os.path.commonpath raises ValueError for different drives
Type: enhancement Stage: resolved
Components: Documentation, Windows Versions: Python 3.8, Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Windson Yang, asvetlov, avi, docs@python, lazka, makdon, paul.moore, pjartman, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: easy, patch

Created on 2019-04-21 09:09 by lazka, last changed 2019-06-30 08:34 by asvetlov. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14045 merged makdon, 2019-06-13 07:30
Messages (7)
msg340604 - (view) Author: Christoph Reiter (lazka) * Date: 2019-04-21 09:09
Since I just got bit by this despite reading the docs:

It lists various error cases where ValueError is raised but is missing the case where absolute paths on Windows are on different drives and I forgot to handle that:

  File "C:/building/msys64/mingw64/lib/python3.7\", line 631, in commonpath
    raise ValueError("Paths don't have the same drive")
ValueError: Paths don't have the same drive
msg340756 - (view) Author: Patrick Artman (pjartman) Date: 2019-04-24 02:54
If this isn't taken I'd be happy to give it a go as my first contribution
msg342273 - (view) Author: Windson Yang (Windson Yang) * Date: 2019-05-13 00:25
An easy fix would be 

"Raise ValueError if paths contain (note: use contain instead of contains) both absolute and relative pathnames or the path are on the different drives."
msg345410 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-06-12 21:19
Flagging as Windows issue.
msg345468 - (view) Author: makdon (makdon) * Date: 2019-06-13 07:30
I create a PR according Windson Yang's suggestion.
msg346921 - (view) Author: Avinash Sajjanshetty (avi) * Date: 2019-06-30 08:09
status of issue should be closed? cos the related PR is already merged
msg346922 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-06-30 08:34
Yes, sure
Date User Action Args
2019-06-30 08:34:42asvetlovsetstatus: open -> closed

nosy: + asvetlov
messages: + msg346922

resolution: fixed
stage: patch review -> resolved
2019-06-30 08:09:11avisetnosy: + avi
messages: + msg346921
2019-06-13 07:30:13makdonsetnosy: + makdon
messages: + msg345468
pull_requests: + pull_request13908

keywords: + patch
stage: needs patch -> patch review
2019-06-12 22:05:08gvanrossumsetnosy: - gvanrossum
2019-06-12 21:19:24gvanrossumsetnosy: + paul.moore, tim.golden, gvanrossum, zach.ware, steve.dower
messages: + msg345410
components: + Windows
2019-05-13 00:25:44Windson Yangsetnosy: + Windson Yang
messages: + msg342273
2019-04-24 02:54:29pjartmansetnosy: + pjartman
messages: + msg340756
2019-04-21 10:16:07serhiy.storchakasetkeywords: + easy
stage: needs patch
versions: + Python 3.7
2019-04-21 09:09:18lazkacreate