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 Chris Billington
Recipients Anthony Sottile, Antony.Lee, Chris Billington, Ivan.Pozdeev, __Vano, barry, brett.cannon, christian.heimes, eric.smith, eric.snow, ethan smith, jaraco, mhammond, ncoghlan, pitrou, takluyver, terry.reedy, vstinner
Date 2019-01-08.16:55:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546966504.25.0.689746659009.issue33944@roundup.psfhosted.org>
In-reply-to
Content
I develop analysis software for physics research, in which the user analyses their data using Python that they write themselves (my application functions as a kind of scheduler for when the analysis scripts should run and with what input). This software has a concept of 'the user's modules', which the user can import from anywhere. When the application is installed, it installs a .pth file to add this 'userlib' folder to the Python path. This way the user can maintain importable modules that they re-use in their analysis without having to put them on PyPI or anything like that (which would be impractical since they are often being hacked on and don't have anything resembling a release cycle). It is important that these modules aren't just available from within the environment my application provides, as that is a bit too rigid - the user should be able to use the normal Python REPL or IPython or whatever to develop and test their code when the 'scheduler' is not in control of running it. 

I'm not sure what I would do instead if .pth files went away. Modifying PYTHONPATH is messy since it applies to all python versions, whereas .pth files are nicely specific only to the one Python installation. sitecustomize.py is messy because if it already exists I need to programmatically modify it to add or remove my changes (and contend with the fact that other packages may be doing the same), whereas a .pth file is nicely separate.

I didn't even know about the arbitrary code execution capabilities of .pth files and don't really care, but keeping the ability to add directories to the Python path would be nice, as the alternatives for doing this are unappealing (and for my application, putting the code the user is hacking on daily deep inside a Conda environment folder hierarchy is unappealing too).
History
Date User Action Args
2019-01-08 16:55:05Chris Billingtonsetrecipients: + Chris Billington, mhammond, barry, brett.cannon, terry.reedy, jaraco, ncoghlan, pitrou, vstinner, eric.smith, christian.heimes, __Vano, eric.snow, takluyver, Antony.Lee, Ivan.Pozdeev, Anthony Sottile, ethan smith
2019-01-08 16:55:04Chris Billingtonsetmessageid: <1546966504.25.0.689746659009.issue33944@roundup.psfhosted.org>
2019-01-08 16:55:04Chris Billingtonlinkissue33944 messages
2019-01-08 16:55:04Chris Billingtoncreate