title: Python os.getenv on OSX (Django 1.4)
body: <p>I just updated an environment to Django 1.4. On syncdb's first run I get the following error:</p>
  
  <pre><code>TypeError: decode() argument 1 must be string, not None
  </code></pre>
  
  <p>This error is triggered by <code>django/contrib/auth/management/init</code>:</p>
  
  <pre><code>try:
      return getpass.getuser().decode(locale.getdefaultlocale()[1])
  except (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).
      # UnicodeDecodeError - preventive treatment for non-latin Windows.
      return u''
  </code></pre>
  
  <p><code>getdefaultlocale</code> returns <code>None</code></p>
  
  <p>After reading <a href="https://code.djangoproject.com/ticket/16017#comment:24">this</a> Django ticket, I tried the unofficial patch which worked, however I think I could do better by figuring out what happends..</p>
  
  <p>So I opened a python command line, and tried:</p>
  
  <pre><code>import os
  print os.getenv()
  None
  os.getenv.__doc__
  "Get an environment variable, return None if it doesn't exist.\n    The optional second argument can specify an alternate default."
  </code></pre>
  
  <p>Could I solve this issue within OSX itself? Tips are welcome</p>