PyErr_SetFromErrnoWithFilename() decodes the filename using

PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
This commit is contained in:
Victor Stinner 2010-05-08 00:35:33 +00:00
parent b001df0040
commit 8d93e49a93
1 changed files with 1 additions and 1 deletions

View File

@ -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;