[issue21368] Check for systemd locale on startup if current locale is set to POSIX

Nick Coghlan report at bugs.python.org
Sun Apr 27 21:30:25 CEST 2014


New submission from Nick Coghlan:

Issue 19977 added "surrogateescape" to the fallback settings for the standard streams if Python 3 appears to be running under the POSIX locale (which Python 3 currently reads as setting a default encoding of ASCII, which is almost certainly wrong on any modern Linux system).

If a modern Linux system is using systemd as the process manager, then there will likely be a "/etc/locale.conf" file providing settings like LANG - due to problematic requirements in the POSIX specification, this file (when available) is likely to be a better "source of truth" regarding the system encoding than the environment where the interpreter process is started, at least when the latter is claiming ASCII as the default encoding.

See http://www.freedesktop.org/software/systemd/man/locale.conf.html for more details.

----------
components: Interpreter Core
messages: 217313
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Check for systemd locale on startup if current locale is set to POSIX
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21368>
_______________________________________


More information about the Python-bugs-list mailing list