[issue43976] Allow Python distributors to add custom site install schemes

Steve Dower report at bugs.python.org
Tue May 4 16:02:01 EDT 2021


Steve Dower <steve.dower at python.org> added the comment:

The best option for restricting the import while still having it be a Python import is to find the file (if it's present in the expected location under sys.whatever), and then use importlib to import it: https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly

I'd rather not have a new option here, I would much prefer "-S" in this context to mean "run Python with only core libraries" and "-s" to mean "run Python with only core and distro libraries" (and neither to mean "run Python with core, distro and user libraries").

That may be a bigger change, but there's enough angst around this issue that we would be better off getting it right this time, even if it changes things, than continuing to preserve the system that people dislike so much.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43976>
_______________________________________


More information about the Python-bugs-list mailing list