[issue36768] distutils.util.convert_path mangles windows paths with forward slashes

Charles P report at bugs.python.org
Wed May 1 10:01:56 EDT 2019


New submission from Charles P <charlespigott at googlemail.com>:

https://github.com/python/cpython/blob/master/Lib/distutils/util.py#L106-L131

Due to the split('/') and os.path.join(), this function converts an absolute path of the form "C:/foobar" into a relative "C:foobar", which is likely to be entirely different

Usecase:

pip install --prefix=/home/charles/python foobar

within an MSYS2 terminal automagically converts the path to C:/Users/charles/python for some reason or another, but it's not exactly uncommon for users to use forward slashes on Windows regardless

I'm not entirely sure what the correct fix would be here, or even if it should be fixed at a higher level - in setuptools or pip

----------
components: Distutils
messages: 341197
nosy: LordAro, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils.util.convert_path mangles windows paths with forward slashes
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36768>
_______________________________________


More information about the Python-bugs-list mailing list