file.write() of non-ASCII characters differs in Interpreted Python than in script run

Marko Rauhamaa marko at
Thu Aug 27 07:59:42 CEST 2015

Chris Angelico <rosuav at>:

> Apache itself most likely is running with LANG=C and other
> environmental changes. It's not a Python-specific thing.

The topic is discussed also at: <URL:

Personally, I think the C locale is the only safe choice for Apache. CGI
shell scripts, in particular, can act in suprising ways when the locale
is changed.


More information about the Python-list mailing list