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 Antony.Lee
Recipients Antony.Lee, Ivan.Pozdeev, barry, brett.cannon, christian.heimes, eric.smith, eric.snow, ethan smith, mhammond, ncoghlan, pitrou, takluyver, terry.reedy
Date 2018-10-25.20:47:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540500427.88.0.788709270274.issue33944@psf.upfronthosting.co.za>
In-reply-to
Content
There are a number of packages that can "self-import" into any Python process depending on the presence of an environment variable, by installing a pth file that contains something like `import os; __import__("thepkg") if os.environ.get("THEENVVAR") else None`.  Examples include colorization of logging output (https://coloredlogs.readthedocs.io/en/latest/api.html#environment-variables) or installation of a trace function (https://pypi.org/project/hunter/#environment-variable-activation).

If the pth mechanism goes away, a preload system should definitely be present to provide a replacement; it should again support multiple packages each installing their own hook.
History
Date User Action Args
2018-10-25 20:47:08Antony.Leesetrecipients: + Antony.Lee, mhammond, barry, brett.cannon, terry.reedy, ncoghlan, pitrou, eric.smith, christian.heimes, eric.snow, takluyver, Ivan.Pozdeev, ethan smith
2018-10-25 20:47:07Antony.Leesetmessageid: <1540500427.88.0.788709270274.issue33944@psf.upfronthosting.co.za>
2018-10-25 20:47:07Antony.Leelinkissue33944 messages
2018-10-25 20:47:07Antony.Leecreate