[Pythonmac-SIG] bundlebuilder --standalone not working
Bob Swerdlow
rswerdlow at transpose.com
Mon Sep 22 10:54:57 EDT 2003
I finally got around to replacing the old xml with _xmlplus, renaming it to
"xml" and sure enough, these problems went away. Thanks for your help with
that!
Now, I find that when I start my application, I get these messages on the
console (they actually appear three times):
'import site' failed; use -v for traceback
RuntimeError: Bad magic number in .pyc file
The build command is:
python
buildapp.py -v --standalone --strip --package=encodings --package=_strptime
--page=urllib2 build
I tried adding "--package=site", but that did not help and in fact, the
output from this command did not list the "site" module as being included.
When I look in the /Content/Resources directory, there IS a site.pyc file
and when I run "python site.pyc" I get no "magic number" error.
What do I need to do to correct this?
Thanks,
Bob
----- Original Message -----
From: "Martina Oefelein" <Martina at oefelein.de>
To: "Bob Swerdlow" <rswerdlow at transpose.com>
Cc: <pythonmac-sig at python.org>
Sent: Friday, September 05, 2003 1:58 PM
Subject: Re: [Pythonmac-SIG] bundlebuilder --standalone not working
> Hi Bob,
>
> > If I build with "python buildapp.py --standalone build", I get
> > ImportError: No module named sax
> > on
> > form xml.sax import saxutils
> >
> > If I build with "python buildapp.py --standalone --package=_xmlplus",
> > I get:
> > ./build/Goombah.app/Contents/Resources/Modules.zip/xmllib.py:10:
> > DeprecationWarning:
> > The xmllib module is obsolete. Use xml.sax instead.
> > and
> > LookupError: unknown encoding: string-escape
> > in pickle.py (the stack trace is attached below).
> >
> > My guess is that _xmlplus is not the package that I need. Is there
> > some
> > other package that is needed to include the sax module?
>
> pyxml is loaded from an ugly "hook" in xml/__init__.py, which looks for
> a package named _xmlplus, and if it exists, munges sys.modules so that
> the module "xml" actually points to _xmlplus. This confuses
> bundlebuilder (and users).
>
> So you need _xmlplus AND xml. Check whether bundlebuilder adds them
> both to your app. If not, use dummy imports to make sure that they
> included.
>
> Or try Just approach (renaming _xmlplus to xml), or try replacing all
> references to module xml in your source with _xmlplus.
>
> I think that these tricks alone still won't work, as some pyxml modules
> load plugin modules (e.g. parsers) dynamically and might not be
> recognized by bundlebuilder. So you have to load these plugins
> explicitly.
>
> ciao
> Martina
>
>
More information about the Pythonmac-SIG
mailing list