#95 Keep LC_*, LANG, set default LC_CTYPE
Merged by rcritten. Opened by cheimes.
cheimes/certmonger lc_ctype  into  master

Python 3.6 and earlier Python 3 require a correctly configured locale to
support non-ASCII values for file names and other parameters. Certmonger
now passes down LANG and LC_* env vars. It also sets LC_CTYPE=C.UTF-8 as
default in case no LC_CTYPE is set.

Fixes: https://pagure.io/certmonger/issue/94
Signed-off-by: Christian Heimes cheimes@redhat.com

Is it intentional that setting LC_CTYPE in the environment will be overridden by this?

LC_CTYPE is forced to C.UTF-8 after the environment is checked (and it is potentially set to something else).

The the opposite around:

  • first certmonger preserves some vars in childenv. My patch adds LANG and LC_*.
  • then all env vars are cleared
  • after that my patch sets LC_CTYPE=C.UTF-8 as sane default
  • finally all preserved childenv values are restored. This overrides LC_CTYPE in case it was set in the certmonger process. Otherwise LC_CTYPE=C.UTF-8 is kept.

I added a comment to setenv("LC_CTYPE", "C.UTF-8", 1);

rebased onto 0288d36e56bab788da3a494142bf9070f9f3aaf9

OK I see it now, ack.

Metadata Update from @rcritten:
- Request assigned

Pull-Request has been merged by rcritten

Metadata