Index: Python/_warnings.c =================================================================== --- Python/_warnings.c (revision 65930) +++ Python/_warnings.c (working copy) @@ -388,7 +388,7 @@ else { const char *msg = "functions overriding warnings.showwarning() " "must support the 'line' argument"; - const char *text_char = _PyUnicode_AsString(text); + const char *text_char = _PyUnicode_AsString(PyObject_Str(text)); if (strcmp(msg, text_char) == 0) { /* Prevent infinite recursion by using built-in implementation