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

Kesh Ikuma report at bugs.python.org
Tue Feb 8 17:48:39 EST 2022

New submission from Kesh Ikuma <tikuma at hotmail.com>:

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-zero exit status 101."

Following the StackOverflow solution, I reinstalled Python for all users and it was working OK. I recently looked into it deeper and found the root issue in the function PC/launcher.c/run_child(). The path to the "...\Python\Python310\python.exe" contains a space, and the CreateProcessW() call on Line 811 is passing the path without quoting the path, causing the process creation to fail.

I fixed my issue by using the Windows short path convention on my path env. variable, but there must be a more permanent fix possible.

Here is the link to my question and self-answering to the problem:


components: Windows
messages: 412874
nosy: hokiedsp, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [venv / PC/launcher] issue with a space in the installed python path
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list