New submission from Phil Thompson:

The use case is a packaging tool that can create a single executable for a 
Python application. Like similar tools it embeds frozen Python code (including 
the standard library) and is linked (often statically) against the interpreter 
library.

Executables are usually configured so that they cannot import packages from the 
filesystem. They can only import packages embedded in the executable. This is 
done directly, ie. the package is not written out to the filesystem and 
imported from there. This is done by a specially written importer.

The importer is installed by adding it to sys.path_hooks. However this must be 
done early on in the bootstrap process so that the parts of the standard 
library that are implemented as Python packages can be found by the installer. 
For example, the point at which the zipimport importer is added to 
sys.path_hooks is too late.

Currently a modified version of bootstrap_external.py is embedded in the 
executable which updates sys.path_hooks at the end of the _install() function.

What I would like is some way to avoid having to modify bootstrap_external.py 
to install a new importer sufficiently early in the bootstrap process to allow 
it to import the standard library.

----------
components: Interpreter Core
messages: 257464
nosy: philthompson10
priority: normal
severity: normal
status: open
title: Request for Support for Embedding the Standard Library in an Executable
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26007>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to