Victor Stinner writes:

 > > If this is needed, it should be spelled "os.getlocaleencoding()" (or
 > > "sys.getlocaleencoding()"?)
 > 
 > There is already a locale.getpreferredencoding(False) function which
 > give your the current locale encoding. The problem is that the current
 > locale encoding may change and so you have to get the new value each
 > time than you would like to encode or decode data.

How can that happen if the programmer (or a module she has imported)
isn't messing with the locale?  If the programmer is messing with the
locale, really they need to be careful.  A magic codec whose encoding
changes *within* a process is an accident waiting to happen.

Do you have a real use case for the "'locale' codec's encoding changes
with the locale within process" feature?
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to