[issue31660] sys.executable different in os.execv'd python3.6 virtualenv session in python2 vs python3

2017-10-01 Thread Stephen Moore

New submission from Stephen Moore :

Hi,

I've come across a problem whereby if you do an os.execv to a python3.6 
virtualenv python inside python2.7 vs python3.6 then the resulting python 
session has a different sys.executable.

Where if you os.execv from python2.7 the sys.executable is equal to the 
virtualenv python

Whereas from python3.6 the resulting python session has a sys.executable of the 
system python.

An example of this in play can be found at 
https://gist.github.com/delfick/d750dc83e3b28e90cef8e2bfbd5b175a

Note that I don't see the problem if the virtualenv is based on python2.7 
(https://gist.github.com/delfick/f1ad6872e2614189a7d98f2583ffc564)

--
components: macOS
messages: 303507
nosy: Stephen Moore, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: sys.executable different in os.execv'd python3.6 virtualenv session in 
python2 vs python3
versions: Python 2.7, Python 3.6

___
Python tracker 
<https://bugs.python.org/issue31660>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31660] sys.executable different in os.execv'd python3.6 virtualenv session in python2 vs python3

2017-10-02 Thread Stephen Moore

Stephen Moore  added the comment:

It appears the problem doesn't appear when using python3 -m venv.

Also it seems __PYVENV_LAUNCHER__ is set to the virtualenv's python except when 
it's a python3.6 virtualenv and we os.execv from python3.6, where it's set the 
system python.

Should I be making an issue with the virtualenv project?

--

___
Python tracker 
<https://bugs.python.org/issue31660>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31660] sys.executable different in os.execv'd python3.6 virtualenv session in python2 vs python3

2017-10-02 Thread Stephen Moore

Stephen Moore  added the comment:

I just realised python3 sets it's own __PYVENV_LAUNCHER__ and if you unset it 
before calling to os.execv, then the virtualenv has the correct sys.executable.

--

___
Python tracker 
<https://bugs.python.org/issue31660>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com