This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, schlamar, steve.dower, tim.golden, zach.ware
Date 2019-02-02.23:04:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549148651.27.0.133420291746.issue35872@roundup.psfhosted.org>
In-reply-to
Content
> This scenario should work, as running the other venv's redirector 
> will update the variable.

The order gets reversed. In the simple case where we have two launchers, the launcher for the nested virtual environment executes the launcher for the outer (creator) virtual environment, which executes the real python.exe. So Python sees the wrong value for __PYVENV_LAUNCHER__. For example, if I create env37_2 from env37_1, here's the result in env37_2:

    C:\>C:\Temp\test\env37_2\scripts\python.exe
    Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28)
    [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys, os
    >>> print(sys.executable)
    C:\Temp\Test\env37_1\scripts\python.exe

    >>> print(*sys.path, sep='\n')

    C:\Program Files\Python37\python37.zip
    C:\Program Files\Python37\DLLs
    C:\Program Files\Python37\lib
    C:\Program Files\Python37
    C:\Temp\Test\env37_1
    C:\Temp\Test\env37_1\lib\site-packages

    >>> print(os.environ['__PYVENV_LAUNCHER__'])
    C:\Temp\Test\env37_1\scripts\python.exe
History
Date User Action Args
2019-02-02 23:04:13eryksunsetrecipients: + eryksun, paul.moore, tim.golden, schlamar, zach.ware, steve.dower
2019-02-02 23:04:11eryksunsetmessageid: <1549148651.27.0.133420291746.issue35872@roundup.psfhosted.org>
2019-02-02 23:04:11eryksunlinkissue35872 messages
2019-02-02 23:04:11eryksuncreate