[Python-checkins] r80950 - python/branches/py3k/Modules/posixmodule.c
victor.stinner
python-checkins at python.org
Sat May 8 02:36:42 CEST 2010
Author: victor.stinner
Date: Sat May 8 02:36:42 2010
New Revision: 80950
Log:
posix_error_with_allocated_filename() decodes the filename with
PyUnicode_DecodeFSDefaultAndSize() and call
PyErr_SetFromErrnoWithFilenameObject() instead of
PyErr_SetFromErrnoWithFilename()
Modified:
python/branches/py3k/Modules/posixmodule.c
Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c (original)
+++ python/branches/py3k/Modules/posixmodule.c Sat May 8 02:36:42 2010
@@ -559,9 +559,13 @@
static PyObject *
posix_error_with_allocated_filename(PyObject* name)
{
- PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError,
- PyBytes_AsString(name));
+ PyObject *name_str, *rc;
+ name_str = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AsString(name),
+ PyBytes_GET_SIZE(name));
Py_DECREF(name);
+ rc = PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
+ name_str);
+ Py_XDECREF(name_str);
return rc;
}
More information about the Python-checkins
mailing list