calling locale.setlocale repeatedly

Michael Goerz answer654 at
Sat Sep 15 21:59:05 CEST 2007


> 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"?


More information about the Python-list mailing list