Being a total cherrypy amateur I'm sure the community will have a much better suggestion than me, but perhaps during your server startup you could create simple socket connections, wrapped in a try/except, and iterate through a range of acceptable port numbers until you get one that's available (and which you have permission for)? Something like this..
import socket
def find_port(acceptable_ports):
port = acceptable_ports.pop()
while port in acceptable_ports:
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
serversocket.bind((socket.gethostname(), port))
return port
except socket.error:
port = acceptable_ports.pop()
raise IOError('No available ports in your range sucked in')
port = find_port(range(1,80))
Goes without saying that this is ad hoc, ugly, probably breaks a whole bunch of import principles of network programming and good process behaviour. I'm sure there's some way to do this in a single line.