Davin Potts added the comment:

Though the code may have changed a bit in the meantime (Issue11750 in 
particular), the calls to _winapi.SetNamedPipeHandleState in 
Lib/multiprocessing/connection.py are still present and largely the same as 
when this issue was first opened.

The implementation of _winapi.SetNamedPipeHandleState still has the potential 
to raise a WindowsError with its message (i.e. e.args[0]) set to whatever the 
Windows GetLastError() function returns.  My reading of the MSDN docs and the 
code in Modules/_winapi.c is as follows:
1. A WindowsError exception is raised only if the Windows function 
SetNamedPipeHandleState returns 0.
2. The Windows function SetNamedPipeHandleState only returns 0 if it failed.
3. When that function fails, the Windows function GetLastError is expected to 
return a non-zero value to provide insight on the nature of the failure.
4. MSDN docs suggest that some functions may call SetLastError with 0 to 
indicate success (seen when subsequently calling GetLastError).  This creates a 
bit of a conundrum given what the OP observed in the provided traceback:  the 
Windows function SetNamedPipeHandleState failed yet the call to GetLastError 
returned a 0.

Possibly the MSDN docs are incomplete on this specific matter and/or there 
could be other environmental factors on the system(s) where this issue has been 
observed not to mention other wrinkles from the OP's reported use of Cython to 
embed the Python interpreter to trigger the issue.  A google search for other 
situations triggering this same behavior did turn up mentions of encountering 
it inside the Wine environment running on Ubuntu -- debugging Wine's 
re-implementation of Windows APIs is certainly out-of-scope here.  It is 
possible that this issue is caused by environmental issues and may not be 
possible to provoke in a supported standard Windows system environment.  
Without a test case or some other way to provoke or reproduce the issue, there 
is little capability to pursue this further.

The OP kindly followed up several years ago to say that he could not find a way 
to reproduce the issue reliably.  Given that, the above review of the code, and 
the search results from looking for other instances of this sort of issue, I am 
going ahead with closing this issue.

----------
nosy: +davin
resolution:  -> rejected
stage: test needed -> resolved
status: open -> closed

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

Reply via email to