Jason R. Coombs avatar Jason R. Coombs committed 7e87ed8

Don't raise an error in server.wait() when testing against loopback interface, which is not guaranteed to exist (and in fact does not exist in common platforms such as rackspace hosting and Heroku). Fixes #1100.

Comments (0)

Files changed (1)

cherrypy/process/servers.py

 
 import sys
 import time
+import warnings
 
 
 class ServerAdapter(object):
         try:
             check_port(host, port, timeout=timeout)
         except IOError:
+            # port is occupied
             return
         else:
             time.sleep(timeout)
 
-    raise IOError("Port %r not bound on %r" % (port, host))
+    if host == client_host(host):
+        raise IOError("Port %r not bound on %r" % (port, host))
+
+    # On systems where a loopback interface is not available and the
+    #  server is bound to all interfaces, it's difficult to determine
+    #  whether the server is in fact occupying the port. In this case,
+    #  just issue a warning and move on. See issue #1100.
+    msg = "Unable to verify that the server is bound on %r" % port
+    warnings.warn(msg)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.