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.

classification
Title: freeze: problems excluding site
Type: enhancement Stage: test needed
Components: Demos and Tools Versions: Python 3.2
process
Status: languishing Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: jasonlowe
Priority: normal Keywords:

Created on 2004-01-16 00:10 by jasonlowe, last changed 2022-04-11 14:56 by admin.

Messages (4)
msg60458 - (view) Author: Jason Lowe (jasonlowe) Date: 2004-01-16 00:10
Python version: 2.3.3
OS: RedHat Linux 7.1

When freezing a script, I'd like to keep the resulting
executable size trimmed down as much as possible.  One
method to do this is to exclude the site module from
the module list (via -x site or -X site), as the site
module triggers the freeze script into including a LOT
of extra modules.

However if one freezes a program with -X site and then
subsequently runs it, the frozen program emits this
warning on startup:

'import site' failed; use -v for traceback

This warning occurs because the frozen program tries to
import site even though freeze.py was explicitly told
to exclude this module.  I'm wondering if "freeze.py -X
site" should generate a main() routine that sets
pythonrun.c's Py_NoSiteFlag before Py_Initialize() ends
up being called.  This would make the site module
exclusion carry over to the frozen program runtime.
msg109740 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-09 14:00
This strikes me as a reasonable request, would someone please like to comment.
msg109780 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2010-07-09 18:41
It sounds reasonable. Just requires someone to write a patch.
msg114310 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-19 00:22
I can't see this happening after 6 1/2 years, feel free to reopen if you want to work on this.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39824
2014-02-03 19:54:52BreamoreBoysetnosy: - BreamoreBoy
2010-08-26 17:16:46r.david.murraysetstatus: closed -> languishing
resolution: wont fix -> accepted
2010-08-19 00:22:49BreamoreBoysetstatus: open -> closed
resolution: wont fix
messages: + msg114310
2010-07-09 18:43:29brett.cannonsetnosy: - brett.cannon
2010-07-09 18:41:16brett.cannonsetnosy: + brett.cannon
messages: + msg109780
2010-07-09 18:38:13brett.cannonsetnosy: - brett.cannon

versions: + Python 3.2, - Python 3.1
2010-07-09 14:00:19BreamoreBoysetnosy: + BreamoreBoy

messages: + msg109740
versions: + Python 3.1, - Python 2.7
2009-02-14 11:35:14ajaksu2setnosy: + brett.cannon
stage: test needed
type: enhancement
versions: + Python 2.7, - Python 2.3
2004-01-16 00:10:13jasonlowecreate