-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add folder for python customizations: __sitecustomize__ #86820
Comments
Following the conversations in https://bugs.python.org/issue33944, wanted to discuss the support for a sitecustomize folder that will hold python scripts to be executed at startup. Similar to This is basically a "supported way" of the current abuse of pth files to add startup code. How will this be useful?
It basically offers a better alternative to the currently abused feature of code execution in pth. I this is something that is wanted in CPython, from the thread in https://bugs.python.org/issue33944 I see some open questions though:
If you want to see "how it feels", see https://github.com/mariocj89/cpython/tree/pu/__sitecustomize__ (It's not finished). If it seems interesting I would love to put a PR through. With this, we might be able to eventually remove code execution in pth files! |
Shouldn't this be discussed on Python-Ideas? I'm pretty sure this is a big enough change that it will need a PEP. If you need code run on startup, can't you just put it in the PYTHONSTARTUP file? |
Indeed, I wanted to see if there was interest in the feature. That is probably a better place to start.
My understanding is that PYTHONSTARTUP is only for interactive executions. Additionally, it suffers from the same issue as sitecustomize. It is a single file that won't be a real substitute for code execution in pth files. |
I thought that the consensus in b.p.o. bpo-33944 is that code execution in (I may be wrong, I'll admit I haven't read the entire thread in 33944.) |
Thread open in Python ideas: https://discuss.python.org/t/add-folder-for-python-customizations-sitecustomize/6190/5 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: