diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-08 00:35:33 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-08 00:35:33 (GMT) |
commit | 8d93e49a93fbea491cd3e9598bc1f308b52a9366 (patch) | |
tree | f93551d181fb9c8f8077fdb42c49292c4a1cb181 /Python | |
parent | b001df0040c8e4472292522708b0ed6ea2501b6f (diff) | |
download | cpython-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.c | 2 |
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; |