[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-09 Thread Kesh Ikuma
Kesh Ikuma added the comment: > a file named "C:\Program". Now the venv launcher won't be able to execute This is exactly what happened on my PC, and the behavior was triggered by Microsoft Visual C++ 2015-2022 Redistributable installer. The installer left a log file "C:\Users\Kesh" with my

[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun
Eryk Sun added the comment: The venv launcher can quote the executable path either always or only when it contains spaces. The following is a suggestion for implementing the latter. Before allocating `executable`, use memchr() (include ) to search the UTF-8 source for a space. If found, incr

[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun
Eryk Sun added the comment: I checked the source code in PC/launcher.c process(). It turns out that `executable` is not getting quoted in the venv launcher case. CreateProcessW() tries to get around this. If the command isn't quoted, it has a loop that consumes up to a space (or tab) and che

[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Kesh Ikuma
Kesh Ikuma added the comment: @eryksun - I knew the reproducibility is the issue with this bug. On the same PC I've been having a problem with, I created another dummy account with a space in its username, and it worked flawlessly... So, it's something I've done to my account which triggered

[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun
Eryk Sun added the comment: run_child() expects `cmdline` to be correctly quoted, and normally it is. I can't reproduce this problem with Python 3.10.2. I created a user account with a space in the account name, logged on, and installed 3.10.2 for the current user, with the option enabled to

[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Kesh Ikuma
New submission from Kesh Ikuma : After months of proper operation, my per-user Python install started to error out when I attempt `python -m venv .venv` with "Error: Command '['C:\\Users\\kesh\\test\\.venv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non