Message328488
| Author | Antony.Lee |
|---|---|
| Recipients | Antony.Lee, Ivan.Pozdeev, barry, brett.cannon, christian.heimes, emma_smith, eric.smith, eric.snow, 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:08 | Antony.Lee | set | recipients: + Antony.Lee, mhammond, barry, brett.cannon, terry.reedy, ncoghlan, pitrou, eric.smith, christian.heimes, eric.snow, takluyver, Ivan.Pozdeev, emma_smith |
| 2018-10-25 20:47:07 | Antony.Lee | set | messageid: <1540500427.88.0.788709270274.issue33944@psf.upfronthosting.co.za> |
| 2018-10-25 20:47:07 | Antony.Lee | link | issue33944 messages |
| 2018-10-25 20:47:07 | Antony.Lee | create | |