summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-08 00:35:33 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-08 00:35:33 (GMT)
commit8d93e49a93fbea491cd3e9598bc1f308b52a9366 (patch)
treef93551d181fb9c8f8077fdb42c49292c4a1cb181 /Python
parentb001df0040c8e4472292522708b0ed6ea2501b6f (diff)
downloadcpython-8d93e49a93fbea491cd3e9598bc1f308b52a9366.zip
cpython-8d93e49a93fbea491cd3e9598bc1f308b52a9366.tar.gz
cpython-8d93e49a93fbea491cd3e9598bc1f308b52a9366.tar.bz2
PyErr_SetFromErrnoWithFilename() decodes the filename using
PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 062658d..274bdbe 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;