A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-August/091362.html below:

[Python-Dev] deleting setdefaultencoding iin site.py is evil

[Python-Dev] deleting setdefaultencoding iin site.py is evil [Python-Dev] deleting setdefaultencoding iin site.py is evilChris Withers chris at simplistix.co.uk
Tue Aug 25 18:08:05 CEST 2009
Hi All,

Would anyone object if I removed the deletion of of 
sys.setdefaultencoding in site.py?

I'm guessing "yes!" so thought I'd state my reasons now:

This deletion appears to be pretty flimsy; reload(sys) and you have it 
back. Which is lucky, because I need it after it's been deleted...

Why? Well, because you can no longer put sitecustomize.py in a 
project-specific location (http://bugs.python.org/issue1734860) and 
because for some projects the only way I can deal with encoded strings 
sensibly is to use setdefaultencoding, in my case at the start of a 
script generated by zc.buildout's zc.recipe.egg (I *know* all the 
encodings in this project are utf-8, but I don't want to go playing 
whack-a-mole with whatever modules this rather large project uses that 
haven't been made properly unicode aware).

Yes, it needs to be used as early as possible, and the docs should say 
this, but deleting it seems to be petty in terms of stopping its use 
when sitecustomize.py is too early and too system-wide and spraying 
.decode('utf-8')'s all over a code base made up of a load of eggs 
managed by buildout simply isn't feasible...

Thoughts?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4