py2exe, PyXML, and utf-16-be Error

D

David Brownell

I am using the XMLValidateParser in the PyXML library
(xml.sax.sax2exts.XMLValParserFactory.make_parser). When I run my
script, everything works as expected.

When I "compile" my script using py2exe, I get the following error
when running the exe:

Traceback (most recent call last):
<my modules removed for brevity>
File "xml\sax\sax2exts.pyc", line 13, in make_parser
File "xml\sax\saxexts.pyc", line 64, in make_parser
File "xml\sax\saxexts.pyc", line 42, in _create_parser
File "xml\sax\drivers2\drv_xmlproc.pyc", line 9, in ?
File "xml\parsers\xmlproc\xmlproc.pyc", line 14, in ?
File "xml\parsers\xmlproc\dtdparser.pyc", line 12, in ?
File "xml\parsers\xmlproc\xmlutils.pyc", line 43, in ?
LookupError: unknown encoding: utf-16-be

While using py2exe, I specify "--packages xml". Is there something
else I need to specify to enable utf-16-be encoding?

Thanks in advance for your help!
David Brownell
 
T

Thomas Heller

I am using the XMLValidateParser in the PyXML library
(xml.sax.sax2exts.XMLValParserFactory.make_parser). When I run my
script, everything works as expected.

When I "compile" my script using py2exe, I get the following error
when running the exe:

Traceback (most recent call last):
<my modules removed for brevity>
File "xml\sax\sax2exts.pyc", line 13, in make_parser
File "xml\sax\saxexts.pyc", line 64, in make_parser
File "xml\sax\saxexts.pyc", line 42, in _create_parser
File "xml\sax\drivers2\drv_xmlproc.pyc", line 9, in ?
File "xml\parsers\xmlproc\xmlproc.pyc", line 14, in ?
File "xml\parsers\xmlproc\dtdparser.pyc", line 12, in ?
File "xml\parsers\xmlproc\xmlutils.pyc", line 43, in ?
LookupError: unknown encoding: utf-16-be

While using py2exe, I specify "--packages xml". Is there something
else I need to specify to enable utf-16-be encoding?

I would guess "--packages xml,encodings" should do the trick.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top