From cb428f01625f99937b59431a53cc8f6013bd3cc2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 27 Dec 2010 20:10:36 +0000 Subject: Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem encoding instead of UTF-8. --- Python/_warnings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/_warnings.c b/Python/_warnings.c index 87755e1edb..51c39e48d4 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -783,7 +783,7 @@ PyErr_WarnExplicit(PyObject *category, const char *text, { PyObject *res; PyObject *message = PyUnicode_FromString(text); - PyObject *filename = PyUnicode_FromString(filename_str); + PyObject *filename = PyUnicode_DecodeFSDefault(filename_str); PyObject *module = NULL; int ret = -1; -- cgit v1.2.1