Ticket #16017: check_for_type_error.diff

File check_for_type_error.diff, 697 bytes (added by tbecker, 3 years ago)

Just check for TypeError and be done with it

  • django/contrib/auth/management/__init__.py

    diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
    index 100acb6..54b60d7 100644
    a b def get_system_username(): 
    8585    """
    8686    try:
    8787        return getpass.getuser().decode(locale.getdefaultlocale()[1])
    88     except (ImportError, KeyError, UnicodeDecodeError):
     88    except (TypeError, ImportError, KeyError, UnicodeDecodeError):
    8989        # KeyError will be raised by os.getpwuid() (called by getuser())
    9090        # if there is no corresponding entry in the /etc/passwd file
    9191        # (a very restricted chroot environment, for example).
Back to Top