Calling locale.setlocale(locale.LC_ALL, locales) overrides user language settings, making e.g. the logger print 'St, 11 dub 2018 19:12:17' instead of 'Wed, 11 Apr 2018 19:12:17'. We don't want that. Therefore, only set the appropriate locale variables.
These should be:
LC_CTYPE for encoding (TODO does Python honor those or do we set them on opening/closing files and separately for STDIN/OUT/ERR?), regex character classes, upcasing/downcasing etc.,
LC_COLLATE for sorting order,
that seems to be it.
Also, maybe default to 'C.UTF-8' instead of 'cs'? It is a non-UNIX-standard value, but it was added to Python for this exact purpose.
Calling
locale.setlocale(locale.LC_ALL, locales)
overrides user language settings, making e.g. the logger print 'St, 11 dub 2018 19:12:17' instead of 'Wed, 11 Apr 2018 19:12:17'. We don't want that. Therefore, only set the appropriate locale variables.These should be:
Also, maybe default to 'C.UTF-8' instead of 'cs'? It is a non-UNIX-standard value, but it was added to Python for this exact purpose.