Re: [Python-ideas] Provide additional debug info for OSError and WindowsError

2019-04-12 Thread eryk sun
On 4/12/19, Giampaolo Rodola' wrote: > > As such I was thinking that perhaps it would be nice to provide 2 new > cPython APIs: > > PyErr_SetFromErrnoWithMsg(PyObject *type, const char *msg) > PyErr_SetFromWindowsErrWithMsg(int ierr, const char *msg) > PyErr_SetExcFromWindowsErrWithMsg(PyObject

[Python-ideas] Provide additional debug info for OSError and WindowsError

2019-04-12 Thread Giampaolo Rodola'
When dealing with C extensions from Python there are circumstances where a function is called and we get an OSError(errno) exception without knowing what exactly went wrong internally. This is especially not obvious on Windows, where multiple MSDN APIs may be invoked within the same C function and