Opened 13 years ago

Closed 13 years ago

#17649 closed Bug (duplicate)

Creating superuser generates exception when system locale is not set

Reported by: chomik Owned by: nobody
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: chomik Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When trying to create superuser with system locale not set (either when syncing db for the first time or invoking manage.py createsuperuser) an exception is rised:

Traceback (most recent call last):
  File "../manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/neaf/sprint/django/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/Users/neaf/sprint/django/django/core/management/__init__.py", line 358, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/neaf/sprint/django/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/neaf/sprint/django/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/Users/neaf/sprint/django/django/contrib/auth/management/commands/createsuperuser.py", line 63, in handle
    default_username = get_default_username()
  File "/Users/neaf/sprint/django/django/contrib/auth/management/__init__.py", line 105, in get_default_username
    default_username = get_system_username()
  File "/Users/neaf/sprint/django/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

Attachments (2)

ticket17649.patch (1.5 KB ) - added by chomik 13 years ago.
suggested solution
ticket17649_2.patch (1.5 KB ) - added by chomik 13 years ago.
test improvement

Download all attachments as: .zip

Change History (5)

by chomik, 13 years ago

Attachment: ticket17649.patch added

suggested solution

by chomik, 13 years ago

Attachment: ticket17649_2.patch added

test improvement

comment:1 by chomik, 13 years ago

Cc: chomik added

comment:2 by neaf, 13 years ago

Component: Uncategorizedcontrib.auth
Triage Stage: UnreviewedReady for checkin
Type: UncategorizedBug

comment:3 by Łukasz Rekucki, 13 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #16017, #17185, #17022.

Note: See TracTickets for help on using tickets.
Back to Top