STINNER Victor added the comment:

> OK, let's do that on Windows first :-)

For the PEP 433, I did something like that in os.get_cloexec() and 
os.set_cloexec():

http://hg.python.org/features/pep-433/file/f32c2b09f332/Modules/posixmodule.c#l10198

On Windows, I added two code paths: one for HANDLE (to support sockets), one 
for file descriptors (classic files). It means that you need a C function 
supports HANDLE as input type, rather than int (file descriptor).

Can't we raise a nice error message when we get a socket, whereas the function 
does not support HANDLE? What is the current message on Windows when passing 
sock.fileno() to a function expecting a file descriptor? Would it be worse if 
Python implictly call .fileno() on a socket?

----------

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

Reply via email to