Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument.
will backport.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 5bf4add..b9a70a0 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -1638,7 +1638,7 @@
}
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sep_obj))
- return PyUnicode_Partition((PyObject *) self, sep_obj);
+ return PyUnicode_RPartition((PyObject *) self, sep_obj);
#endif
else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
return NULL;