Message 192827 - Python tracker
FWIW, I couldn't find any use of getdefaultlocale in any of the hg revisions (using hg grep) in https://bitbucket.org/birkenfeld/sphinx/ Instead, it's (probably) docutils, which has this code: locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1] # locale.getpreferredencoding([do_setlocale=True|False]) # has side-effects | might return a wrong guess. # (cf. Update 1 in http://stackoverflow.com/questions/4082645/using-python-2-xs-locale-module-to-format-numbers-and-currency) I find that quite unfortunate, since locale.getpreferredencoding() would have don the right thing (IMO).