Opened 12 years ago

Closed 12 years ago

#18065 closed Bug (duplicate)

manage.py createsuperuser fails if LC_ALL is empty

Reported by: anonymous Owned by: nobody
Component: Core (Management commands) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):

File "./manage.py", line 9, in <module>

execute_from_command_line(sys.argv)

File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line

utility.execute()

File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv

self.execute(*args, options.dict)

File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute

output = self.handle(*args, options)

File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle

return self.handle_noargs(options)

File "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs

emit_post_sync_signal(created_models, verbosity, interactive, db)

File "/usr/lib/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal

interactive=interactive, db=db)

File "/usr/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send

response = receiver(signal=self, sender=sender, named)

File "/usr/lib/python2.7/site-packages/django/contrib/auth/management/init.py", line 73, in create_superuser

call_command("createsuperuser", interactive=True, database=db)

File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 150, in call_command

return klass.execute(*args, defaults)

File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute

output = self.handle(*args, options)

File "/usr/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle

default_username = get_default_username()

File "/usr/lib/python2.7/site-packages/django/contrib/auth/management/init.py", line 105, in get_default_username

default_username = get_system_username()

File "/usr/lib/python2.7/site-packages/django/contrib/auth/management/init.py", line 85, in get_system_username

return getpass.getuser().decode(locale.getdefaultlocale()[1])

TypeError: decode() argument 1 must be string, not None
adys@azura ~/test % python -c "import locale; print(locale.getdefaultlocale())"
(None, None)

Change History (1)

comment:1 by Aymeric Augustin, 12 years ago

Resolution: duplicate
Status: newclosed

Please :

  • use the formatting tools and the Preview button to ensure your tickets are readable before submitting them;
  • check the problem isn't already reported: #17649, #17185, #17022, #16017
Note: See TracTickets for help on using tickets.
Back to Top