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 <>
> 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:

    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)

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

    C:\Program Files\Python37\
    C:\Program Files\Python37\DLLs
    C:\Program Files\Python37\lib
    C:\Program Files\Python37

    >>> print(os.environ['__PYVENV_LAUNCHER__'])
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: <>
2019-02-02 23:04:11eryksunlinkissue35872 messages
2019-02-02 23:04:11eryksuncreate