mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-107913: Fix possible losses of OSError error codes (GH-107930)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be called immediately after using the C API which sets errno or the Windows error code.
This commit is contained in:
parent
e407cea193
commit
2b15536fa9
17 changed files with 129 additions and 75 deletions
|
@ -736,8 +736,8 @@ _locale_bindtextdomain_impl(PyObject *module, const char *domain,
|
|||
}
|
||||
current_dirname = bindtextdomain(domain, dirname);
|
||||
if (current_dirname == NULL) {
|
||||
Py_XDECREF(dirname_bytes);
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
Py_XDECREF(dirname_bytes);
|
||||
return NULL;
|
||||
}
|
||||
result = PyUnicode_DecodeLocale(current_dirname, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue