Commit 93b77cd
committed
gh-148315: Shell-quote the
The `command = ...` record written to `pyvenv.cfg` by
`venv.EnvBuilder.create_configuration` was assembled with a plain
`' '.join(args)` and an unquoted `sys.executable`. When any of these
tokens contained whitespace (for example a Windows user directory like
`C:\Users\Z B\...`), the recorded command was no longer a faithful
reproduction and truncated at the first space when shell-parsed.
Build the full argv as a list and emit it via `shlex.join`, and split
`--prompt="..."` into two separate argv tokens so its value is quoted
by `shlex.join` as well.command line in pyvenv.cfg1 parent e872c19 commit 93b77cd
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| |||
0 commit comments