mirror of
https://github.com/python/cpython.git
synced 2025-07-12 22:05:16 +00:00
Fix PyString_Format() so that '%c' % u'a' returns u'a'
instead of raising a TypeError. (From SF patch #710127) Add tests to verify this is fixed. Add various tests for '%c' % int.
This commit is contained in:
parent
2a04623ddd
commit
43440a621e
5 changed files with 18 additions and 0 deletions
|
@ -543,6 +543,7 @@ class MixinStrUnicodeUserStringTest:
|
|||
self.checkequal('"', "%c", '__mod__', 34)
|
||||
self.checkequal('$', "%c", '__mod__', 36)
|
||||
self.checkequal('10', "%d", '__mod__', 10)
|
||||
self.checkequal('\x7f', "%c", '__mod__', 0x7f)
|
||||
|
||||
for ordinal in (-100, 0x200000):
|
||||
# unicode raises ValueError, str raises OverflowError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue