◐ Shell
clean mode source ↗

Message 343847 - Python tracker

> I think it would be best to replace the two calls with 
> PyErr_SetFromWindowsErr(0) (for now).

For now it can at least be implemented inline. For example:

    if (handle == NULL) {
        PyObject *temp = name ? PyUnicode_FromWideChar(name, -1) : NULL;
        PyErr_SetExcFromWindowsErrWithFilenameObjects(PyExc_OSError,
            0, temp, NULL);
        Py_XDECREF(temp);
        handle = INVALID_HANDLE_VALUE;
    }

I think undeprecating the two PyErr_ functions with a modified signature in 3.8 is okay since they were never in the documented API, never in the stable (limited) API, and Py_UNICODE has been a typedef for wchar_t since 3.3.