diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 372cf433ca2..34bca682d0e 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -177,7 +177,7 @@ PyFile_WriteString(const char *s, PyObject *f) return -1; } else if (!PyErr_Occurred()) { - PyObject *v = PyString_FromString(s); + PyObject *v = PyUnicode_FromString(s); int err; if (v == NULL) return -1;