diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-12 23:01:12 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-12 23:01:12 (GMT) |
commit | 80a1bf4b5db4880f01d30b89ab5f6c436d50c8e6 (patch) | |
tree | b8d9f619c12790ad63bf1f044b7e08fd4aa29bf8 /Lib | |
parent | 0b9e3f750cc91e83d9614dd941545a8b29fa248a (diff) | |
download | cpython-80a1bf4b5db4880f01d30b89ab5f6c436d50c8e6.zip cpython-80a1bf4b5db4880f01d30b89ab5f6c436d50c8e6.tar.gz cpython-80a1bf4b5db4880f01d30b89ab5f6c436d50c8e6.tar.bz2 |
Fix SF # 635969, No error "not all arguments converted"
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
newstr = 'format without a percent' % string_value
This fix raises an exception again when there are no formats
and % with a string value.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_format.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py index b40e820..da4d85a 100644 --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -221,6 +221,14 @@ if have_unicode: 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: |