Message 89136 - Python tracker
To add a little bit more analysis: posix.device_encoding requires that the LC_CTYPE is set. Setting it just in this function would not be possible, as setlocale is not thread-safe. So for 3.1, it seems that Python must set LC_CTYPE. If somebody can propose a patch that avoids that for 3.2, I'd be certainly in favor.