diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-03-02 22:45:06 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-03-02 22:45:06 +0100 |
| commit | 327c98ff08a95205919df4ae31dc633c1acec643 (patch) | |
| tree | 094b5254071a56d1845f51feb906b2dbf1940085 | |
| parent | 142728277a9be9a16e7e87086fbcd95041ae4071 (diff) | |
[1.5.x] Fixed #19933 -- Catched ValueError in get_system_username
Thanks lanre.hbs at gmail.com for the report.
| -rw-r--r-- | django/contrib/auth/management/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py index a77bba0f73..34492d24e0 100644 --- a/django/contrib/auth/management/__init__.py +++ b/django/contrib/auth/management/__init__.py @@ -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: |
