Re: [Boa Constr] boa & unicode : sitecustomize.py not read
Status: Beta
Brought to you by:
riaan
From: Werner F. B. <wer...@fr...> - 2008-09-29 22:05:42
|
Denis, spir wrote: > Hello, > > I read in the doc that, in order to use unicode with boa, one should add > a sitecustomize.py module with a setdefaultencoding("utf-8") > instruction, either to the python directory, or to the Lib/site-packages > one, or to the boa directory. I choose the last solution in order not to > disturb other modules. > Note that my source files always start with "# -*- coding:utf-8 -*-". > But it does not work. Actually, sitecustomize.py is not even read, there > is no .pyc file generated. When I try to open a source file with > non-ascii chars, I get the usual ascii codec error, for instance: > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position > 27: ordinal not in range(128)" (Oxe9 is the code for 'é'). > Copying sitecustomize.py to the python directory does not solve the > problem. In fact, this kind of error messages even constantly happens in > the boa file-open dialog, even though my directory and file names don't > hold any non-ascii character. # Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] # wxPython 2.8.8.1, Boa Constructor 0.6.1 # Type "copyright", "credits" or "license" for more information. >>> import sys >>> sys.getdefaultencoding() 'utf-8' >>> I work in Unicode for some time now with Boa. My sitecustomize.py is in the Python root. Can you provide more information on what you are running, i.e. Boa version, and OS. Also, I hope that you are not using the boa.exe as that would explain why non of the locations for your sitecustomize.py seem to work. The .exe version is built with py2exe and therefor will use whatever is it was built against (which is an ANSI build). Werner |