Jason R. Coombs <jar...@jaraco.com> added the comment:

In [setuptools 1453](https://github.com/pypa/setuptools/issues/1453), this 
issue hit the project hard. Tox 3.2 changed the default invocation of pip from 
the script-based invocation to the runpy based implementation (python -m pip), 
which causes pip to be unable to uninstall the setuptools in the environment.

This use case also reveals that the heuristic of "retain '' in sys.path if the 
module being executed is in a subdirectory of a current directory" wouldn't 
address the issue, as `.tox/python/lib/python3.7/site-packages/pip/__main__.py` 
is in a subdirectory of the current directory, but one would still expect '' 
not to be in sys.path in this case.

But basing on __main__.__spec__, that would probably do what is expected.


Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to