Forcing import of sitecustomize.py

Thomas F.B. tarball at phreaker.foo
Mon Nov 3 18:48:18 EST 2003


On Tue, 04 Nov 2003 10:00:09 +1300, Jamie wrote:
>
> I'm deploying a python application packaged as an executable with py2exe.
> I'm forcing the import of sitecustomize.py to set the default encoding...
>

"Don't do this!" (MHO)

I used sitecustomize.py, too. But after having nothing but trouble with
3rd party modules, py2exe, McMillan Installer etc. etc. I decided to write
my applications in such a way that they do not depend on a specific
default encoding. (E.g. things which worked with one version of py2exe
etc. did not work with the next version etc.)

My opinion:

sitecustomize.py is fine for small python scripts which you use on your
own system (admin scripts, daily work etc.). It allows you to program
without caring about encodings and stuff (i.e. to be lazy :-) But for 
applications which you want to deploy, I would not recommend to make use 
of or to rely on the default encoding set in sitecustomize.py.

Thomas

-- 
mailto: tarball at phreaker.foo (foo = net)




More information about the Python-list mailing list