Opened 12 years ago

Closed 12 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


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

Traceback (most recent call last):
  File "../", line 9, in <module>
  File "/Users/neaf/sprint/django/django/core/management/", line 419, in execute_from_command_line
  File "/Users/neaf/sprint/django/django/core/management/", line 358, in execute
  File "/Users/neaf/sprint/django/django/core/management/", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/neaf/sprint/django/django/core/management/", line 232, in execute
    output = self.handle(*args, **options)
  File "/Users/neaf/sprint/django/django/contrib/auth/management/commands/", line 63, in handle
    default_username = get_default_username()
  File "/Users/neaf/sprint/django/django/contrib/auth/management/", line 105, in get_default_username
    default_username = get_system_username()
  File "/Users/neaf/sprint/django/django/contrib/auth/management/", 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 12 years ago.
suggested solution
ticket17649_2.patch (1.5 KB ) - added by chomik 12 years ago.
test improvement

Download all attachments as: .zip

Change History (5)

by chomik, 12 years ago

Attachment: ticket17649.patch added

suggested solution

by chomik, 12 years ago

Attachment: ticket17649_2.patch added

test improvement

comment:1 by chomik, 12 years ago

Cc: chomik added

comment:2 by neaf, 12 years ago

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

comment:3 by Łukasz Rekucki, 12 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #16017, #17185, #17022.

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