diff Python/errors.c @ 61384:07a47a514548

PyErr_SetFromErrnoWithFilename() decodes the filename using PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
author Victor Stinner <victor.stinner@haypocalc.com>
date Sat, 08 May 2010 00:35:33 +0000
parents 3357b8ebb259
children cab14be0ada1
line wrap: on
line diff
--- a/Python/errors.c	Sat May 08 00:07:07 2010 +0000
+++ b/Python/errors.c	Sat May 08 00:35:33 2010 +0000
@@ -446,7 +446,7 @@
 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;