mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-11 06:18:11 +03:00
Avoid crashing if LC_ALL is not defined by user (issue #517)
This commit is contained in:
parent
2f7c672054
commit
3c9fba3dcf
@ -95,7 +95,15 @@ def main():
|
||||
Run it...
|
||||
"""
|
||||
# Setup translations
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
except locale.Error:
|
||||
# Issue #517
|
||||
# Setting LC_ALL to '' should not generate an error unless LC_ALL is not
|
||||
# defined in the user environment, which can be the case when used via SSH.
|
||||
# So simply skip this error, as python will use the C locale by default.
|
||||
logger.warning("No locale LC_ALL variable found. Use the default C locale.")
|
||||
pass
|
||||
gettext.install(gettext_domain, locale_dir)
|
||||
|
||||
# Share global var
|
||||
|
Loading…
Reference in New Issue
Block a user