New submission from Christian Heimes <li...@cheimes.de>:

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 #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.

----------
messages: 309224
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Add socket.close(fd) function
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to