Library
-------
+- Issue #28732: Fix crash in os.spawnv() with no elements in args
+
- Issue #28485: Always raise ValueError for negative
compileall.compile_dir(workers=...) parameter, even when multithreading is
unavailable.
"spawnv() arg 2 must be a tuple or list");
return NULL;
}
+#ifdef MS_WINDOWS
+ /* Avoid changing behavior in maintenance release, but
+ the previous Windows behavior was to crash, so this
+ is a "compatible" improvement. */
+ if (argc == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "spawnv() arg 2 cannot be empty");
+ return NULL;
+ }
+#endif
argvlist = PyMem_NEW(char *, argc+1);
if (argvlist == NULL) {
mode = _P_OVERLAY;
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
spawnval = _spawnv(mode, path_char, argvlist);
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
free_string_array(argvlist, argc);
mode = _P_OVERLAY;
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
spawnval = _spawnve(mode, path_char, argvlist, envlist);
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
if (spawnval == -1)
do {
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
res = _cwait(&status, pid, options);
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
if (res < 0)