◐ Shell
clean mode source ↗

Message 320264 - Python tracker

Can you say on which Linux platform/release you see this behavior and with which Python 3.6.3, i.e. from the platform distributor or built yourself?  If I understand your concern correctly, I cannot reproduce that behavior on a current Debian test system using either the Debian-supplied 3.6.6rc1 or with a  3.6.3 built from source.  With either LANG unset or set to C (and with no LC* env vars set), I see:

$ unset LC_ALL LC_CTYPE LANG LANGUAGE
$ ./python
Python 3.6.3 (tags/v3.6.3:2c5fed86e0, Jun 22 2018, 16:08:11)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()
(None, None)
>>> locale.getdefaultlocale()
(None, None)

Note that, as documented, the locale.getdefaultlocale() checks several env vars 'LC_ALL', 'LC_CTYPE', 'LANG' and 'LANGUAGE'.  Are you certain that all of those env vars are unset when you run this test?

https://docs.python.org/3.6/library/locale.html#locale.getdefaultlocale