Index: Objects/unicodeobject.c =================================================================== --- Objects/unicodeobject.c (revision 82975) +++ Objects/unicodeobject.c (working copy) @@ -9242,7 +9242,7 @@ else if (c >= '0' && c <= '9') { prec = c - '0'; while (--fmtcnt >= 0) { - c = Py_CHARMASK(*fmt++); + c = *fmt++; if (c < '0' || c > '9') break; if ((prec*10) / 10 != prec) { Index: Lib/test/test_unicode.py =================================================================== --- Lib/test/test_unicode.py (revision 82964) +++ Lib/test/test_unicode.py (working copy) @@ -757,6 +757,7 @@ self.assertRaises(OverflowError, "%c".__mod__, (0x110000,)) self.assertEqual('%c' % '\U00021483', '\U00021483') self.assertRaises(TypeError, "%c".__mod__, "aa") + self.assertRaises(ValueError, "%.1\u1032f".__mod__, (1.0/3)) # formatting jobs delegated from the string implementation: self.assertEqual('...%(foo)s...' % {'foo':"abc"}, '...abc...')