[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-27 Thread STINNER Victor
STINNER Victor added the comment: > 5) Remove PathFinder if filesystem imports are disabled Extract of importlib._bootstrap_external._install(): def _install(_bootstrap_module): ... sys.meta_path.append(PathFinder) PathFinder is always registered. So you are not only asking for an AP

[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-25 Thread Gregory Szorc
Gregory Szorc added the comment: Having approached this with a fresh brain, I was able to port PyOxidizer to use the multi-phase initialization API with minimal regressions! The relevant code exists at https://github.com/indygreg/PyOxidizer/blob/b5aa2b3a96dbd01e9d78857e124f1052f42f86c6/pyemb

[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-20 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +eric.snow, ncoghlan, steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-20 Thread STINNER Victor
STINNER Victor added the comment: The current workaround is to use PyConfig._init_main=0, call Py_InitializeFromConfig(), tune Python, and then call _Py_InitializeMain() to finish the "main" initialization: https://docs.python.org/dev/c-api/init_config.html#multi-phase-initialization-private

[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-19 Thread Gregory Szorc
New submission from Gregory Szorc : I'm porting PyOxidizer to the PEP 587 APIs. So far, it is mostly straightforward. I was looking forward to adopting the multi-phase initialization API because I thought it would enable me to get rid of the very ugly hack PyOxidizer uses to inject its custo

[issue40333] Request for multi-phase initialization API to run code after importlib init

2020-04-19 Thread Gregory Szorc
Change by Gregory Szorc : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma