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 steve.dower
Recipients FFY00, frenzy, hroncok, jaraco, petr.viktorin, steve.dower
Date 2021-05-04.20:02:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620158521.34.0.494096498476.issue43976@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-05-04 20:02:01steve.dowersetrecipients: + steve.dower, jaraco, petr.viktorin, hroncok, frenzy, FFY00
2021-05-04 20:02:01steve.dowersetmessageid: <1620158521.34.0.494096498476.issue43976@roundup.psfhosted.org>
2021-05-04 20:02:01steve.dowerlinkissue43976 messages
2021-05-04 20:02:01steve.dowercreate