py2exe, PyXML, and utf-16-be Error

Discussion in 'Python' started by David Brownell, Aug 23, 2004.

  1. 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
    David Brownell, Aug 23, 2004
    #1
    1. Advertising

  2. (David Brownell) writes:

    > 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
    Thomas Heller, Aug 23, 2004
    #2
    1. Advertising

  3. Thanks, Thomas, that did the trick.
    David Brownell, Aug 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kathleen Kudzma

    py2exe & pyxml

    Kathleen Kudzma, Sep 16, 2003, in forum: Python
    Replies:
    9
    Views:
    638
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Oct 16, 2003
  2. David Dorward
    Replies:
    2
    Views:
    770
    Uche Ogbuji
    Feb 28, 2004
  3. F. GEIGER
    Replies:
    0
    Views:
    915
    F. GEIGER
    Aug 16, 2004
  4. python
    Replies:
    3
    Views:
    1,782
    Simon Brunning
    May 22, 2006
  5. H.S.
    Replies:
    12
    Views:
    1,329
    Victor Bazarov
    Aug 10, 2007
Loading...

Share This Page