title: "getaddrinfo() argument 1 must be string or None" error starting dev_appserver.py on Linux
body: <p>I'm getting re-started with App Engine after not having used it in a while.  I'm using the 64-bit Linux Go runtime, version 1.8.1.</p>
  
  <p>I believe I'm following the steps from the documentation correctly, and I believe I'm doing what's worked correctly in the past, but I'm getting this error when attempting to launch <code>dev_appserver.py</code>:</p>
  
  <pre>
  $ dev_appserver.py .
  INFO     2013-07-11 07:24:45,919 sdk_update_checker.py:244] Checking for updates to the SDK.
  INFO     2013-07-11 07:24:46,230 sdk_update_checker.py:288] This SDK release is newer than the advertised release.
  WARNING  2013-07-11 07:24:46,443 simple_search_stub.py:955] Could not read search indexes from /tmp/appengine.batterybotinfo.darshan/search_indexes
  Traceback (most recent call last):
    File "/home/darshan/bin/dev_appserver.py", line 182, in 
      _run_file(__file__, globals())
    File "/home/darshan/bin/dev_appserver.py", line 178, in _run_file
      execfile(script_path, globals_)
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 695, in 
      main()
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 688, in main
      dev_server.start(options)
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 659, in start
      apis.start()
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 137, in start
      super(APIServer, self).start()
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 295, in start
      if self._start_all_dynamic_port(host_ports):
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 348, in _start_all_dynamic_port
      server.start()
    File "/home/darshan/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 194, in start
      socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
  TypeError: getaddrinfo() argument 1 must be string or None
  </pre>
  
  <p>My first thought was that I might be using an incorrect version of Python.  Sure enough, I'm using 2.7.5, and <a href="https://developers.google.com/appengine/docs/go/gettingstarted/devenvironment" rel="nofollow">the documentation</a> clearly states that 2.5 is necessary.  However, the documentation seems to be outdated, because after installing 2.5 and setting my system to use it, I got this error:</p>
  
  <pre>
  Error: Python 2.5 is not supported. Please use version 2.7.
  </pre>
  
  <p>Okay, so back to 2.7.5 and my initial error.</p>
  
  <p>I'm not sure if this is a bug in the <code>dev_appserver.py</code> Python code (I'm guessing not, as it's been out for a month), an issue with my Python installation, or something else about my system that isn't configured according to Google's expectations.</p>
  
  <p>I'd rather not mess with the <code>dev_appserver.py</code> code unless necessary, but I'm happy to poke at it to help figure out what's going wrong.  The error is on line 194; here are lines 190-195:</p>
  
  <pre class="lang-python prettyprint-override"><code># AF_INET or AF_INET6 socket
  # Get the correct address family for our host (allows IPv6 addresses)
  host, port = self.bind_addr
  try:
    info = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
                              socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
  </code></pre>
  
  <p>I've determined that the containing method is called twice.  The first time <code>host</code> is always <code>"127.0.0.1"</code> and <code>port</code> is <code>0</code>.  The second time is the one that crashes; <code>host</code> is always <code>10</code> (an int, not a string), and <code>port</code> is a seemingly-random five-digit int.</p>
  
  <p>I've tried hard-coding <code>host</code> to <code>"127.0.0.1"</code> and <code>port</code> to either <code>8080</code> or <code>0</code>, but then I get another error. I feel in over my head, and I suspect I'm not going to resolve the real issue by changing things I don't really understand.  Googling for the error message hasn't helped.</p>