Skip to content

Improve locale handling #13

@vidraj

Description

@vidraj

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions