[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-12 Thread Michael Ferguson
Michael Ferguson added the comment: > The way sys.prefix is calculated on macOS ensures that the correct sys.prefix > is calculated even if you copy the binary to a different location. That's > functionality I don't want to drop. I agree with you that it's important for t

[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson
Michael Ferguson added the comment: > For example, when I run the test exec on my macOS system, it is clear that > the python3 being invoked is not the venv one but a different python3 > altogether that shows up earlier on PATH. In the test case I am interested in, PATH i

[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson
Michael Ferguson added the comment: > I'm not sure I understand exactly what you are trying to accomplish but one > potential issue strikes me: you may need to ensure you are execing the right > python binary by including a more complete path: That does not help with the original

[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson
Michael Ferguson added the comment: In the above I meant to include the `bin` path in the examples, but it does not matter for the behavior (exec -a test-venv/bin/python3 python3 -c 'import sys; print(sys.executable); print (sys.prefix

[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson
New submission from Michael Ferguson : I have been trying to create a wrapper script for `python3` in a venv that behaves similarly to a symbolic link. I am able to use `exec -a` in bash to run `python3` with `argv[0]` set to the wrapper script. This allows it to function similarly