You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
os.close(fd) of a socket fd does not work some platforms, e.g. Windows. In the past we have used socket.socket(fileno=fd).close() to close a socket in a platform independent way. With bpo-28134 it may no longer work in all cases, most noticeable when the socket has neither been connected nor bound yet and auto-detection of type and family is used.
Instead of adding more hacks, I propose to add a socket.close(fd) function as cross-platform way to close a socket fd. It won't be the first function that mimics an o' module function. The socket module already has the undocumented socket.dup(fd) function.
Activity
tiran commentedon Dec 30, 2017
os.close(fd) of a socket fd does not work some platforms, e.g. Windows. In the past we have used socket.socket(fileno=fd).close() to close a socket in a platform independent way. With bpo-28134 it may no longer work in all cases, most noticeable when the socket has neither been connected nor bound yet and auto-detection of type and family is used.
Instead of adding more hacks, I propose to add a socket.close(fd) function as cross-platform way to close a socket fd. It won't be the first function that mimics an o' module function. The socket module already has the undocumented socket.dup(fd) function.
tiran commentedon Jan 27, 2018
New changeset d0e31b9 by Christian Heimes in branch 'master':
bpo-32454: socket closefd (bpo-5048)
d0e31b9