test_exc('%d', '1', TypeError, "int argument required")
test_exc('%g', '1', TypeError, "float argument required")
+test_exc('no format', '1', TypeError,
+ "not all arguments converted during string formatting")
+test_exc('no format', u'1', TypeError,
+ "not all arguments converted during string formatting")
+test_exc(u'no format', '1', TypeError,
+ "not all arguments converted during string formatting")
+test_exc(u'no format', u'1', TypeError,
+ "not all arguments converted during string formatting")
if sys.maxint == 2**32-1:
# crashes 2.2.1 and earlier:
arglen = -1;
argidx = -2;
}
- if (args->ob_type->tp_as_mapping && !PyTuple_Check(args))
+ if (args->ob_type->tp_as_mapping && !PyTuple_Check(args) &&
+ !PyObject_TypeCheck(args, &PyBaseString_Type))
dict = args;
while (--fmtcnt >= 0) {
if (*fmt != '%') {
arglen = -1;
argidx = -2;
}
- if (args->ob_type->tp_as_mapping && !PyTuple_Check(args))
+ if (args->ob_type->tp_as_mapping && !PyTuple_Check(args) &&
+ !PyObject_TypeCheck(args, &PyBaseString_Type))
dict = args;
while (--fmtcnt >= 0) {