[1.5.x] Fixed #19933 -- Catched ValueError in get_system_username

Thanks lanre.hbs at gmail.com for the report.
This commit is contained in:
Claude Paroz 2013-03-02 22:45:06 +01:00
parent 142728277a
commit 327c98ff08
1 changed files with 4 additions and 1 deletions

View File

@ -133,7 +133,10 @@ def get_system_username():
# (a very restricted chroot environment, for example).
return ''
if not six.PY3:
default_locale = locale.getdefaultlocale()[1]
try:
default_locale = locale.getdefaultlocale()[1]
except ValueError:
return ''
if not default_locale:
return ''
try: