Issue #1178 duplicate

[Python3.3] [cherrypy-3.2.2] Change in python3.3 OS and IO exception hierarchy breaking server startup

Anonymous created an issue

http://docs.python.org/3.3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy

As stated in the link above, IOError and socket.error are changed as aliases to the OSError.

In effect it breaks the function check_port(host, port, timeout=1.0) in cherrypy/process/servers.py, at the try-except block.

raise IOError("Port %s is in use on %s; perhaps the previous "
                          "httpserver did not shut down properly." %
                          (repr(port), repr(host)))

will be caught by the following except clause under Python3.3:

except socket.error:
            if s:
                s.close()

which in python3.2 should be raised to the caller instead.

The result is the start listener will fail with IOError('Port %r not bound on %r" % (port, host)) even when port is in fact bound on host.

Comments (3)

  1. Log in to comment