Kaydet (Commit) 77ccd6d0 authored tarafından Victor Stinner's avatar Victor Stinner

posix_error_with_allocated_filename() decodes the filename with

PyUnicode_DecodeFSDefaultAndSize() and call
PyErr_SetFromErrnoWithFilenameObject() instead of
PyErr_SetFromErrnoWithFilename()
üst 8d93e49a
...@@ -559,9 +559,13 @@ posix_error_with_unicode_filename(Py_UNICODE* name) ...@@ -559,9 +559,13 @@ posix_error_with_unicode_filename(Py_UNICODE* name)
static PyObject * static PyObject *
posix_error_with_allocated_filename(PyObject* name) posix_error_with_allocated_filename(PyObject* name)
{ {
PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, PyObject *name_str, *rc;
PyBytes_AsString(name)); name_str = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AsString(name),
PyBytes_GET_SIZE(name));
Py_DECREF(name); Py_DECREF(name);
rc = PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
name_str);
Py_XDECREF(name_str);
return rc; return rc;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment