mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fallback to default locale (en_US) if env. setting is corrupt.
This commit is contained in:
committed by
Rob Crittenden
parent
bfca99b420
commit
bbc94034b0
@@ -196,7 +196,11 @@ class LanguageAwareTransport(Transport):
|
||||
def get_host_info(self, host):
|
||||
(host, extra_headers, x509) = Transport.get_host_info(self, host)
|
||||
|
||||
lang = locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
|
||||
try:
|
||||
lang = locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
|
||||
except locale.Error:
|
||||
# fallback to default locale
|
||||
lang = 'en_us'
|
||||
|
||||
if not isinstance(extra_headers, list):
|
||||
extra_headers = []
|
||||
|
||||
Reference in New Issue
Block a user