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 ncoghlan
Recipients illera88, ncoghlan, vstinner
Date 2018-07-08.04:26:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531024010.68.0.56676864532.issue34057@psf.upfronthosting.co.za>
In-reply-to
Content
encodings is only the *first* unfrozen Python module that we load - once you get past that, then you'll find that we also load os.py and various other things.

cx_freeze is an illustrative example to look at in that regard, as it preconfigures the interpreter to be able to find the cx_freeze generated zip archive that has the program's Python modules in it: https://github.com/anthony-tuininga/cx_Freeze/blob/master/source/bases/Common.c

The technique that cx_freeze doesn't use yet is to combine the statically linked Python binary and the generated zip archive into a single file (similar to what zipapp does), and adjust the sys.path definition inside the binary to refer back to the executable itself (since executable files can have arbitrary content appended, while zip files can have arbitrary content *pre*pended).

We're always going to require that embedding applications provide a working import path of some kind, so this isn't a bug.

It might be worth converting to a documentation enhancement request though, as we don't really make it clear in https://docs.python.org/3/c-api/init.html what the "minimum viable import set" actually looks like.
History
Date User Action Args
2018-07-08 04:26:50ncoghlansetrecipients: + ncoghlan, vstinner, illera88
2018-07-08 04:26:50ncoghlansetmessageid: <1531024010.68.0.56676864532.issue34057@psf.upfronthosting.co.za>
2018-07-08 04:26:50ncoghlanlinkissue34057 messages
2018-07-08 04:26:50ncoghlancreate