[issue45020] Freeze all modules imported during startup.

Marc-Andre Lemburg report at bugs.python.org
Tue Aug 31 14:53:27 EDT 2021


Marc-Andre Lemburg <mal at egenix.com> added the comment:

On 31.08.2021 20:14, Brett Cannon wrote:
> 
> Brett Cannon <brett at python.org> added the comment:
> 
>> set __file__ (and __path__) on frozen modules?
> 
> See https://bugs.python.org/issue21736

The patch on that ticket is straight from PyRun, where the
__file__ location is set in a way which signals that the file
does not exist, but instead is baked into the executable:

>>> import os
>>> os.__file__
'<pyrun>/os.py'

Not doing this breaks too many tests in the test suite for no
good reason, which is why I mentioned "practicality beats
purity" in the ticket.

----------

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


More information about the Python-bugs-list mailing list