summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-08 00:35:33 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-08 00:35:33 +0000
commit95b5bbac56711054014d793264819be0b34c7764 (patch)
treef7da6fc27529736978fdca5e275d7ca8117d9d40 /Python/errors.c
parent122aa3574de7e6b341502e5bfde280d2d47f7266 (diff)
downloadcpython-95b5bbac56711054014d793264819be0b34c7764.tar.gz
PyErr_SetFromErrnoWithFilename() decodes the filename using
PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 062658d737..274bdbe476 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -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;