Open zooba opened 3 years ago
Presumably the "real" fix here for CPython will be in pip
and will eventually be adopted into ensurepip
, but the underlying issue belongs to distutils
.
This issue might have been fixed incidentally in #23, except that backward compatibility for $
substitutions was retained.
But more important is that literal characters in the path should never trigger substitutions.
I started to explore how it might be possible to allow these characters to pass without triggering substitutions, but then I realized that it's currently possible for someone to pass values that the intend to be substituted, like:
setup.py install --install-purelib '$userbase/foo' ...
# or
setup.py install --install-purelib '{userbase}/foo' ...
And in that case, distutils would substitute the userbase value just as it does for sysconfig-supplied parameters.
I'm not sure if that's a supported use-case or an incidental behavior that should be disallowed.
If use-cases demand that substitutions be allowed for supplied parameters (and not just those from sysconfig or defaults), then it will be impossible to distinguish $userbase
(literal) from $userbase
(intended substitution) when supplied.
I think it's going to be difficult to solve this until we can have this codebase widely adopted, so I'm going to defer this until after Setuptools is using it by default.
We are seeing this issue as well. But we made the (questionable) decision to use a $ sign in the user name of the executing user (on Windows).
To work around the issue decribed above we would set the environment variable test
to $test
. This works, because the substitution is only executed once and not recursively. Then it finds the variable and substitutes it with the original string, effectively doing nothing.
(Migrated from https://bugs.python.org/issue33193 - the below text is from a reply with more useful context than the OP)
An exotic case, but it also affects Linux:
So the venv actually gets created, but it's ensurepip which chokes on the $.