mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
PyErr_SetFromErrnoWithFilename() decodes the filename using
PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
This commit is contained in:
@@ -446,7 +446,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
|
||||
PyObject *
|
||||
PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
|
||||
{
|
||||
PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
|
||||
PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
|
||||
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
|
||||
Py_XDECREF(name);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user