Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Erik Bethke
Hello All,

So I have been using Effbot's XML stuff a lot!  And I have been using
py2exe, pygame and wxPython all mixed together...

I am getting this strange error log when writing XML files with his XML
writer.  It appears to be fouling up on the encoding, ONLY in the exe
version.  Runs fine and great as a python script.

What this does is leave the file hanging open...

I could write out the XML myself, but I would rather use his class...
any ideas why it broke?

Thank you,
-Erik

code snippet:
def SaveVocabTree( self ):
ElementTree( self.vocabXMLTree ).write(self.currentPath,
encoding='utf-8')

error log:
Traceback (most recent call last):
  File vocab.py, line 457, in OnAdd
  File vocab.py, line 483, in AddWord
  File vocab.py, line 494, in SaveVocabTree
  File elementtree\ElementTree.pyc, line 666, in write
  File elementtree\ElementTree.pyc, line 684, in _write
  File elementtree\ElementTree.pyc, line 754, in _encode
LookupError: unknown encoding: utf-8

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Simon Brunning
On Tue, 08 Feb 2005 08:35:51 -0800 (PST), Erik  Bethke
[EMAIL PROTECTED] wrote:
 I am getting this strange error log when writing XML files with his XML
 writer.  It appears to be fouling up on the encoding, ONLY in the exe
 version.  Runs fine and great as a python script.

http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain

-- 
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Fredrik Lundh
Erik Bethke wrote:

 So I have been using Effbot's XML stuff a lot!  And I have been using
 py2exe, pygame and wxPython all mixed together...

 I am getting this strange error log when writing XML files with his XML
 writer.  It appears to be fouling up on the encoding, ONLY in the exe
 version.  Runs fine and great as a python script.

you need to explicitly tell py2exe to include the relevant encodings
(from the encodings package in the standard library).  adding a simple

import encodings.utf_8

to your script might help.  if not, see the following wiki page:

http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain

/F 



-- 
http://mail.python.org/mailman/listinfo/python-list