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 barry
Recipients Anthony Sottile, Chris Billington, Ivan.Pozdeev, Peter L3, SilentGhost, __Vano, barry, brett.cannon, cheryl.sabella, christian.heimes, eric.smith, eric.snow, ethan smith, ionelmc, jaraco, mhammond, ncoghlan, pitrou, steve.dower, takluyver, terry.reedy, veky
Date 2019-02-28.18:04:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <ADF3E4D8-CB52-4302-9111-CC667B02B08D@python.org>
In-reply-to <1551375616.83.0.524645842496.issue33944@roundup.psfhosted.org>
Content
On Feb 28, 2019, at 09:40, Anthony Sottile <report@bugs.python.org> wrote:
> 
> I don't think even this is unanimous.  Things like registering codecs, instrumenting coverage in subprocesses, etc. all seem like legitimate uses of the arbitrary code execution feature

Except pth files are a terrible interface for that, given all the other problems, including weird wall-of-code inducing restrictions on what actually gets executed.

I’m in agreement with Steve Dower in principle here.  I would like to see a solution that deprecates and eventually removes arbitrary code execution in pth files, leaves sys.path extension alone (for now <wink>), and improves the discoverability and debuggability of magical pth files.

What I think Anthony is looking for are ways to register “start up functions” that get executed automatically when the Python interpreter starts up.  Perhaps somewhat analogous to atexit functions?  But if we’re going to officially support a feature like that, I think a PEP would be the right vehicle to suss out all the gory details, like, should these things be global across all invocations of the interpreter, how a user or application would disable that, how would bugs in start up functions get discovered, reported, and debugged, what if any execution order guarantees should be made, etc.
History
Date User Action Args
2019-02-28 18:04:08barrysetrecipients: + barry, mhammond, brett.cannon, terry.reedy, jaraco, ncoghlan, pitrou, eric.smith, christian.heimes, ionelmc, SilentGhost, __Vano, eric.snow, takluyver, steve.dower, veky, Ivan.Pozdeev, Anthony Sottile, ethan smith, cheryl.sabella, Chris Billington, Peter L3
2019-02-28 18:04:08barrylinkissue33944 messages
2019-02-28 18:04:08barrycreate