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.

classification
Title: pth files in site-packages of venvs are executed twice
Type: Stage:
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee, sinoroc, wim.glenn
Priority: normal Keywords:

Created on 2017-09-21 09:41 by Antony.Lee, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg302678 - (view) Author: Antony Lee (Antony.Lee) * Date: 2017-09-21 09:41
All's in the title: "pth files in site-packages of venvs are executed twice".  For example, the following code sample prints "1" twice.

python -mvenv /tmp/tmpenv
echo 'import os; print(1)' >/tmp/tmpenv/lib/python3.6/site-packages/foo.pth
source activate /tmp/tmpenv
python

This behavior is different from the one for a pth file in a non-venv site-packages (either the syswide prefix, or the user prefix), which is only executed once.
msg362308 - (view) Author: (sinoroc) * Date: 2020-02-20 11:02
https://stackoverflow.com/a/60169657/11138259
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75723
2020-02-20 11:02:15sinorocsetnosy: + sinoroc
messages: + msg362308
2019-11-09 05:11:14wim.glennsetnosy: + wim.glenn
2017-09-21 09:41:38Antony.Leecreate