[issue23314] Disabling CRT asserts in debug build
STINNER Victor
report at bugs.python.org
Thu Feb 12 12:56:15 CET 2015
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 appear)."
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 test.support.SuppressCrashReport.__enter__. 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);
+ }
+#endif
The function is not available if _DEBUG is not defined? Why not calling the function if _DEBUG is not defined?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23314>
_______________________________________
More information about the Python-bugs-list
mailing list