Ticket #15778: django-createsuperuser-8bit-username-bug.diff
File django-createsuperuser-8bit-username-bug.diff, 707 bytes (added by , 14 years ago) |
---|
-
django/contrib/auth/management/commands/createsuperuser.py
a b 58 58 59 59 # Try to determine the current system user's username to use as a default. 60 60 try: 61 default_username = getpass.getuser().replace(' ', '').lower()61 default_username = str(getpass.getuser().decode('ascii', 'ignore')).replace(' ', '').lower() 62 62 except (ImportError, KeyError): 63 63 # KeyError will be raised by os.getpwuid() (called by getuser()) 64 64 # if there is no corresponding entry in the /etc/passwd file