diff Python/_warnings.c @ 67161:6f19622dd342

Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem encoding instead of UTF-8.
author Victor Stinner <victor.stinner@haypocalc.com>
date Mon, 27 Dec 2010 20:10:36 +0000
parents 39b9e9de372b
children 3c9232a684ae
line wrap: on
line diff
--- a/Python/_warnings.c	Mon Dec 27 20:09:32 2010 +0000
+++ b/Python/_warnings.c	Mon Dec 27 20:10:36 2010 +0000
@@ -783,7 +783,7 @@
 {
     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;