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