mirror of
https://github.com/python/cpython.git
synced 2025-08-08 19:09:46 +00:00
[3.11] gh-107913: Fix possible losses of OSError error codes (GH-107930) (GH-108524)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.
(cherry picked from commit 2b15536fa9
)
This commit is contained in:
parent
8a275f7c01
commit
b9fc536399
17 changed files with 129 additions and 77 deletions
|
@ -7556,7 +7556,7 @@ decode_code_page_errors(UINT code_page,
|
|||
if (err != ERROR_NO_UNICODE_TRANSLATION
|
||||
&& err != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
PyErr_SetFromWindowsErr(err);
|
||||
goto error;
|
||||
}
|
||||
insize++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue