mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
PyErr_SetFromErrnoWithFilename() decodes the filename using
PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
This commit is contained in:
parent
b001df0040
commit
8d93e49a93
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue