Closed bradfeehan closed 6 months ago
Yeah, I knew paths with spaces would probably not be handled correctly because that is not a practical problem on Linux systems. You have prompted me to do program arguments properly. From the commit 870f1eb:
Now all command line arguments are created and passed internally as a sequence (of string args) for eventually passing to subprocess.run()
and a shell is never used so we don't have to worry about shell quoting trickery.
This change is released as version 1.14.
@bradfeehan, can I please ask: Did this program work fine on a Mac after I fixed this?
Installing with the script, I get this error:
Cause
The virtualenv is created in a path with a space, which is interpreted as two arguments to the
uv
command, instead of one argument containing a space.The default path for PIPXU_HOME is set in pipxu/pipxu.py:124.
This refers to
platformdirs.user_data_dir()
which is a good practice. However on MacOS this is "${HOME}/Library/Application Support", and it causes the error when thePIPXU_HOME
contains a space.Potential fix
A hacky solution would be to quote the directory, but then directories containing
"
quote characters would fail (kinda pathological but also technically possible).As a better solution, it probably shouldn't use shell quoting rules to execute subprocesses. Instead, use an interface that allows passing arguments as individual strings, so nothing requires quoting.
Workaround
Manually tell
pipxu
to store its stuff in a directory with no space characters in the path: