STINNER Victor added the comment:

> According to hg bisect: (...)
> summary:     Issue #23834: Add sock_call() helper function

Oh, I'm not too surprised. I had to modify _deeply_ socketmodule.c to implement 
the PEP 475. I stressed the code on Linux, but on Windows I only ran Python 
test suite and asyncio test suite.

The surprising part is that the bug was not detected by any test :-(

We need at least one more unit test for it.

> The problem starts earlier in sock_accept_impl. This function checks whether 
> SOCKET_T ctx->result is non-negative to determine whether the accept call 
> succeeded, but SOCKET_T is unsigned on Windows.

Thanks, good analysis. I checked accept() documentation and Python 3.4 source 
code: yeah, we must check for INVALID_SOCKET. It's a dummy copy/paste failure. 
I copied the code from another sock_xxx_impl() function, and I didn't notice 
that the error condition is different for accept(). The code fails in some 
cases on Windows, but not always. Maybe only on 64-bit?

> My system according to Python:
> ...
> '3.5.0b3 (default, Jul  5 2015, 07:00:46) [MSC v.1900 64 bit (AMD64)]'

My Windows is also 64-bit but my Visual Studio version (2010 Express) was 
limited to 32-bit :-(

Right now, I cannot develop on Windows: Visual Studio 2010 doesn't want to 
compile Python anymore (issue #24737). I'm downloading Windows 8.1 and I will 
try Visual Studio 2015. So I pushed a fix without being able to test it :-(

----------

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

Reply via email to