mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the filesystem encoding instead of UTF-8.
This commit is contained in:
parent
83098a4095
commit
92be939695
4 changed files with 11 additions and 6 deletions
|
@ -515,7 +515,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
|
|||
int ierr,
|
||||
const char *filename)
|
||||
{
|
||||
PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
|
||||
PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
|
||||
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
|
||||
ierr,
|
||||
name);
|
||||
|
@ -552,7 +552,7 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
|
|||
int ierr,
|
||||
const char *filename)
|
||||
{
|
||||
PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
|
||||
PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
|
||||
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
|
||||
PyExc_WindowsError,
|
||||
ierr, name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue