-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Policy for altering sys.path #68323
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
Comments
I am missing a policy how sys.path should be altered. We run a custom sub class of list in sys.path. We set it in sitecustomize.py This instance get replace by a common list in lines like this: sys.path = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path The above line is from pip, it similar things happen in a lot of packages. Before trying to solve this with code, I think the python community should agree an a policy for altering sys.path. What can I do to this done? We use Python 2.7. |
My guess, unfortunately, is give up. There is too much code in the field that replaces sys.path with a regular list. What you propose is effectively an impossible social engineering problem. You may well also run into issues where the Python C code calls list methods directly even if sys.path is a subclass of list. (I don't know that that is true, but there are certainly places where the C code does that kind of thing). Could you get consensus to change stdlib and pip practice? That's at least conceivable. I guess python-ideas would be the place to start for that. I'm going to close the issue, since this would be a PEP level change if you are successful. (Frankly, I don't think you are likely to be successful, but I don't hang out on python-ideas so I might be wrong :) |
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: