[issue28134] socket.socket(fileno=fd) does not work as documented

YoSTEALTH report at bugs.python.org
Fri Feb 23 21:22:17 EST 2018


YoSTEALTH <ritesh at stealthcentral.com> added the comment:

Christian thank you for your reply, i really appreciate it.

Lets analyze this a bit:
- Technically speaking i can "return client" directly and it would NOT close the socket.
- Shouldn't "inside" having reference to same fd mean +1 to reference count. Considering its a new object?
id(client): 140340037397192
id(inside): 140340010863560

I could understand making a duplicate of the fd if it were being passed across thread/process but in its original thread making a duplicate! This behavior is extremely odd.

I fell like everyone that uses socket(fileno) will run into days wasted and frustration just to figure out these solutions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28134>
_______________________________________


More information about the Python-bugs-list mailing list