Unicode error in exefied Python script

Martin v. Löwis martin at v.loewis.de
Mon Jan 20 09:54:59 CET 2003


Christian Bretterklieber <cb at orcl.net> writes:

>   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).

Perhaps you have changed the system default encoding in site.py? You
should not do this.

>   Any ideas?

If you haven't changed the system default encoding, you should find
out why the script works when run with an installed Python. Inspect
the line that causes the exception, and find out whether you are
converting byte \x80 to a Unicode string. If this won't happen, you
are just using different data in both cases.

Regards,
Martin





More information about the Python-list mailing list