Permalink
Browse files

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

Thanks lanre.hbs at gmail.com for the report.
  • Loading branch information...
1 parent 1427282 commit 327c98ff08a95205919df4ae31dc633c1acec643 @claudep claudep committed Mar 2, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 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:

0 comments on commit 327c98f

Please sign in to comment.