Unicode error in exefied Python script

Christian Bretterklieber cb at orcl.net
Sun Jan 19 23:14:51 EST 2003


Hi,

  I have a problem with a Python script that I want to make executable
on Win2K (I'm using ActivePython 2.2.1 in case that matters). The
script does some database stuff. The exefied version (both with py2exe
and Gordon McMillan's Installer) on a simple statement:

  stmt = "UPDATE blah SET val1 = '%s', [...]" % (row[xval1],...)

  The error message it throws is "UnicodeError: ASCII decoding error:
Ordinal not in range (128)". Interestingly enough, the script as is
works, just not the exefied version (The --packages encodings option to
py2exe was given, of course).

  I searched the web for this error message and tried some of the advice
I found (creating a sitecustomize.py; changing the default encoding in
site.py). None of this helped, though. What also puzzles me is the fact
that an older version of the program works (exefied on the same system).
The program has undergone some major changes meanwhile but the code in
question was just copied and pasted from the old version.

  Any ideas?

TIA,

c/hris.

-- 
Quitting vi is the most important command of that editor,
and should be bound to something easy to type and available
in all modes, for example the space bar.
                               -- Per Abrahamsen




More information about the Python-list mailing list