AW: Global unicode setting for Py2Exe

Dear Robin,
A call to "sys.setdefaultencoding('iso-8859-1')", which is the only row (in
addition to the sys module import) in my sitecustomize.py, seems not to be
allowed inside the startup script. If i put it before the call to
"wx.PySimpleApp()" the application crashes with a disallowed NULL pointer
access, putting it after the instanciation of the application class results
in a traceback that the sys module doesn't contain an attribute called
"setdefaultencoding", which matches well all documentation i read about
changing the global unicode setting. But maybe you ment to put it somewhere
else in the code..?
Help is still appreciated. Thank you.
Best regards
Oliver

···

-----Ursprüngliche Nachricht-----
Von: Robin Dunn [mailto:robin@alldunn.com]
Gesendet: Dienstag, 4. Mai 2004 19:26
An: wxPython-users@lists.wxwidgets.org
Betreff: Re: [wxPython-users] Global unicode setting for Py2Exe

Oliver Walczak wrote:

Dear List,
In a current project i use minidom to import and parse a project XML file
and fill up the user interface with these values. For my python

installation

(Python 2.3.3, wxPython 2.5.1.5) I use a sitecustomize.py file to set the
internal string codec globally to "iso-8859-1". The XML parser in the
distributed project (generated with py2exe) fails with the well known

error

"ordinal not in range (128)" etc.
I was looking around the net and found many threads about this issue, but
i'm still uncomfortable with the answers. So there's just a very simple
question and maybe somebody has got the answer:
Can I customize the unicode codec in the standalone application generated
with py2exe or ain't that possible, even not in a future release of

py2exe?

In the setup.py i already defined
options={"py2exe":{"packages":["encodings"]...
and all string codecs are well contained in the project. If the global
unicode setting cannot be customized there is only the call to encode()
decode() to those strings, am i right? This would cause a lot of work,
though...

Why not move the code you put in sitecustomize.py into the startup code
of your app?

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org