1
0
mirror of https://github.com/django/django.git synced 2025-04-16 13:24:38 +00:00

[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

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: