Yes, this is because of the (unfortunate) availability of the dup()
operation. Originally, dup() was only available on Unix, where it's
implemented in the kernel at the file descriptor level: when several
file descriptors all share the same underlying socket, the socket
isn't really closed until th
In implementing the IronPython _socket module, I've discovered some
puzzling behavior in the standard Python socket wrapper module:
socket._socketobject.close() doesn't actually close sockets; rather, it
just sets _sock to an instance of _closedsocket and lets the GC clean up
the real socket. (See