diff --git a/Python/_warnings.c b/Python/_warnings.c index 87755e1..51c39e4 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;