calling locale.setlocale repeatedly

Michael Goerz answer654 at 8439.e4ward.com
Sat Sep 15 15:59:05 EDT 2007


Hi,

From
http://www.pyzine.com/Issue008/Section_Articles/article_Encodings.html#guessing-the-encoding:
> The way to access the information about the "normal" encoding used on the current computer is through the locale module. Before using locale to retrieve the information you want, you need to call locale.setlocale(locale.LC_ALL, ''). Because of the sensitivity of the underlying C locale module on some platforms, this should only be done once.

Why should the call
locale.setlocale(locale.LC_ALL, '')
only be made once? What exactly is the "sensitivity of the underlying C
locale module"?


Thanks,
Michael



More information about the Python-list mailing list