Closed ehaupt closed 5 years ago
What does import locale ; locale.getpreferredencoding()
return? What OS are you on?
# python3.6
Python 3.6.7 (default, Dec 4 2018, 01:10:52)
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.0 (tags/RELEASE_600/final 326565)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getpreferredencoding()
'UTF-8'
This is due to my custom locale:
$ locale
LANG=C
LC_CTYPE=de_CH.UTF-8
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY=de_CH.UTF-8
LC_MESSAGES="C"
LC_ALL=
On a vanilla FreeBSD installation you'd get:
$ locale
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
# python3.6
Python 3.6.7 (default, Dec 4 2018, 01:10:52)
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.0 (tags/RELEASE_600/final 326565)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale ; locale.getpreferredencoding()
'US-ASCII'
I'm inclined to say that non-UTF locales are unsupported.
I mean, we could explicitly specify encoding everywhere and it's a technically correct solution. OTOH, all our tooling is based on Click, which very explicitly does not support ASCII locales, so it's somewhat pointless. So explicit encoding would only support other non-UTF locales (iso8859-*? shift-jis?) which are rather rare these days and personally I'm okay with declaring them unsupported.
What do you think @prusnak?
I am fine with declaring non-UTF-8 locales as unsupported.
alright, closing
Fix build with python 3.6