Just van Rossum suggested I file this bug report:
When building with
python -O buildapp.py -v --standalone --
package=encodings --package=_strpTime --packag
e=urllib2 build
I got these errors:
'import site' failed; use -v for traceback
Traceback(most recent call last):
file "./build/MyApp.app/Contents/Resources/myapp.py",
line 6, in ?
import copy
ImportError: No module named copy
The "import copy" problem is simply cascaded off
the "import site" problem. A site.pyo file was generated
in the /build/MyApp.app/Contents/Resources/folder, but
it is obviously not being used properly.
To get it to work, I first built the application without
the -O flag, saved the site.pyc file, then built it again
with the -O flag and restored the site.pyc file. With this
hack, the application works fine.
Just responded:
I think you need to hack the bootstrap script by adding
sys.argv.insert(1, "-O")
after this line:
sys.argv.insert(1, mainprogram)
He also asked if -O was really worth the trouble, but
that should be the programmer's decision, not the
framework's. bundlebuilder should support --standalone
with -O.
|