Ticket #17185: get_username.patch
File get_username.patch, 787 bytes (added by , 13 years ago) |
---|
-
django/contrib/auth/management/__init__.py
82 82 username could not be determined. 83 83 """ 84 84 try: 85 return getpass.getuser().decode(locale.getdefaultlocale()[1]) 85 locale_encoding = locale.getdefaultlocale()[1] 86 if locale_encoding is None: 87 locale_encoding = 'ascii' 88 return getpass.getuser().decode(locale_encoding) 86 89 except (ImportError, KeyError, UnicodeDecodeError): 87 90 # KeyError will be raised by os.getpwuid() (called by getuser()) 88 91 # if there is no corresponding entry in the /etc/passwd file