STINNER Victor added the comment:

"When we completely switch Windows builds over to VC14, we're going to 
encounter some new assert dialogs from the CRT. (...) A number of tests attempt 
operations on bad file descriptors, which will assert and terminate in MSVCRT 
(I have a fix for the termination coming, but the assertions will still 

Can you give some examples of tests which fail with an assertion error?

_PyVerify_fd() doesn't protect use against the assertion error?

I would prefer to keep CRT error checks, to protect us against bugs.


Instead of patching faulthandler, you should patch This function already calls 
SetErrorMode(). Instead of ctypes, the function may be exposed in the _winapi 
module for example. I'm talking about SetErrorMode() *and* _CrtSetReportMode().

+#if defined MS_WINDOWS && defined _DEBUG
+    if ((p = Py_GETENV("PYTHONNOCRTASSERT")) && *p != '\0') {
+        _CrtSetReportMode(_CRT_ASSERT, 0);
+    }

The function is not available if _DEBUG is not defined? Why not calling the 
function if _DEBUG is not defined?


Python tracker <>
Python-bugs-list mailing list

Reply via email to