Éric Araujo added the comment:

> Wow that is a very compelling argument that I am hesitant to raise a counter 
> point against.

I was not making an argument to describe a choice made by Python developers, 
but describing how unix shells have been working for the last decades.  The 
behavior you observe is not related to Python at all, so it’s not in our hands 
to change for 3.4 or any future version.

> So why does this issue not affect the interpreter in the venv itself, only 
> pip and easy_install, or
> other such tools with-in the venv? It seems to me that the activate script 
> gets around this somehow for
> the interpreter, as it ran fine in the directory with a space in the name.

If I understand correctly, you mean that after activating a venv, you can type 
“python” and get the venv’s Python to run, but you if you type “pip” you get 
the error message about the space in the path.  The difference here, to expand 
RDM’s reply, is that more things happen when you run pip.

When you run “python”, the system splits the PATH environment variable on “:”, 
walks each dir found to see if their is an executable file named “python” 
there, and when found, runs it (it’s compiled code that can run directly).  
This works because the paths in PATH are separated with a colon, so one path 
can contain spaces.

When you run “pip”, the steps above are done, then the shebang system is 
invoked: the pip file is not a binary executable but a script (text) file, so 
the shell or kernel will use another program to run that script, the shell by 
default or another program specified shebang.  A shebang is defined as “#!” + 
optional space + path without spaces + arguments (not supported by all 
systems).  That’s the issue here.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20622>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to