[Pythonmac-SIG] bundlebuilder --standalone not working
Martina Oefelein
Martina at Oefelein.de
Fri Sep 5 20:58:50 EDT 2003
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