When you do a "server.bindAndListen()", if the port is
used, the object raises an error. Fine. But the object
keeps a FD, and it doesn't clean the FP up.
Usually this is not an issue, since when we garbage
collect the object or the object is reused, the FD is
cleaned up. But if the server object is "leaked" (for
example, we keep references for any reason), the FD is
also leaked.
If you have only a server object, this is a non issue.
But if you work with a lot of server objects, this is a
risk.
Check:
>>> import xmlrpc
>>> a=[]
>>> for i in range(50) :
... b=xmlrpc.server()
... try :
... b=xmlrpc.bindAndListen(80) # Use a locally
"already" used port
... except :
... pass
... a.append(b)
...
(here we keep 50 server objects around)
>>> b=open("/etc/passwd")
>>> b.fileno()
53 <- The server objects keeps the FD around
Logged In: YES
user_id=184164
fixed in 0.8.6
Logged In: YES
user_id=97460
I see the very same error in 0.8.6. Please, execute the code
I posted and see yourself.
Logged In: YES
user_id=184164
Sorry about the mix-up. I really have fixed this in 0.8.7