Fall back to C locale if UTF8 version does not exist

This can happen on RHEL 6 or 7. All current Fedora version have it.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-05-10 15:24:29 +02:00
parent 9da70ee7a9
commit dc69281025

View File

@ -27,7 +27,11 @@ from pungi import get_full_version, util
# force C locales # force C locales
locale.setlocale(locale.LC_ALL, "C.UTF-8") try:
locale.setlocale(locale.LC_ALL, "C.UTF-8")
except locale.Error:
# RHEL < 8 does not have C.UTF-8 locale...
locale.setlocale(locale.LC_ALL, "C")
COMPOSE = None COMPOSE = None