Message283410
Seems there are quite a few typos/copy-paste errors in the original steps-to-reproduce. Here are my steps on macOS:
$ ./python-build/python.exe -m venv 'aaa bbb'
$ source ./aaa\ bbb/bin/activate
$ pip
zsh: /Users/yen/tmp/aaa bbb/bin/pip: bad interpreter: "/Users/yen/tmp/aaa: no such file or directory
The result is similar on Linux.
Like Alex said, I don't think there's a portable solution, either, so here's a patch to warn users for possibly broken paths.
macOS kernel has another bug/limitation. In XNU, '#' symbol also breaks shebang:
$ ./python-build/python.exe -m venv 'aaa#bbb'
$ source ./aaa\#bbb/bin/activate
$ pip
zsh: /Users/yen/tmp/aaa#bbb/bin/pip: bad interpreter: /Users/yen/tmp/aaa#bbb/bin/python: no such file or directory
This is even confusing as the kernel thinks the interpreter is /Users/yen/tmp/aaa (everything after the first # is thrown away, see [1]) while zsh/bash thinks it's /Users/yen/tmp/aaa#bbb/bin/python. As a result, I add a warning for #, too
Some related discussions:
1. https://github.com/pypa/pip/issues/923 (pip does not support spaces in directories names)
2. https://github.com/pypa/virtualenv/issues/53 (Whitespace in root path of virtualenv breaks scripts)
3. https://github.com/pypa/virtualenv/issues/973 (bad interpreter error when creating virtualenv's in directories with '#' in name)
Adding venv maintainer and some macOS experts
[1] https://opensource.apple.com/source/xnu/xnu-3789.21.4/bsd/kern/kern_exec.c.auto.html, line 511 |
|
Date |
User |
Action |
Args |
2016-12-16 15:27:43 | yan12125 | set | recipients:
+ yan12125, vinay.sajip, ronaldoussoren, ned.deily, alexreg |
2016-12-16 15:27:43 | yan12125 | set | messageid: <1481902063.65.0.453077686058.issue28446@psf.upfronthosting.co.za> |
2016-12-16 15:27:43 | yan12125 | link | issue28446 messages |
2016-12-16 15:27:42 | yan12125 | create | |
|