Fix bug in last checkin (2.231). To match previous behavior, unicode
subclasses should be substituted as-is and not have tp_str called on
them.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 9bcae0f..05deb3a 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -4078,6 +4078,11 @@
break;
case 's':
#ifdef Py_USING_UNICODE
+ if (PyUnicode_Check(v)) {
+ fmt = fmt_start;
+ argidx = argidx_start;
+ goto unicode;
+ }
temp = _PyObject_Str(v);
if (temp != NULL && PyUnicode_Check(temp)) {
Py_DECREF(temp);