#645: A value of 0 for socket_port should cause CP to bind to an avaibale unused
port
---------------------------------+------------------------------------------
Reporter:
drag...@gmail.com | Owner: rdelon
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Keywords:
---------------------------------+------------------------------------------
When socket_port is specified as 0, an exception is thrown as follows:
{{{
File
"/localhome/raghu/localwork/cherrypy/
svn.cherrypy.org/trunk/cherrypy/_cpserver.py",
line 69, in quickstart
self.start()
File
"/localhome/raghu/localwork/cherrypy/
svn.cherrypy.org/trunk/cherrypy/_cpserver.py",
line 95, in start
self._start_http(httpserver)
File
"/localhome/raghu/localwork/cherrypy/
svn.cherrypy.org/trunk/cherrypy/_cpserver.py",
line 118, in _start_http
self.wait(httpserver)
File
"/localhome/raghu/localwork/cherrypy/
svn.cherrypy.org/trunk/cherrypy/_cpserver.py",
line 159, in wait
wait_for_occupied_port(*bind_addr)
File
"/localhome/raghu/localwork/cherrypy/
svn.cherrypy.org/trunk/cherrypy/_cpserver.py",
line 247, in wait_for_occupied_port
raise IOError(msg)
IOError: Port 0 not bound on 'localhost'
}}}
I am using the latest code from the trunk. It appears to me that even
though wsgiserver is properly passing 0 to socket.bind (and hence binding
to an unused port), other parts of the code still use "configured" port
which is 0.
--
Ticket URL: <
http://www.cherrypy.org/ticket/645>
CherryPy <
http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework