Unicode error in exefied Python script

Christian Bretterklieber cb at orcl.net
Mon Jan 20 16:09:40 EST 2003


Martin v. L?wis <martin at v.loewis.de> wrote:

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

  I have now found the difference. When I execute the script,
sys.getdefaultencoding() returns 'cp1252'. After creating a .exe file, the
output is 'ascii'. Creating the sitecustomize.py and even calling
sys.setdefaultencoding() directly in site.py did not have any impact
whatsoever.

  Is there another simple method to set the default encoding? And what
might be the cause for the exefied script to have a different encoding?

TIA,

c/hris.

-- 
This is Linux country. If you listen carefully, you can hear Windows reboot..




More information about the Python-list mailing list