diff options
author | Georg Brandl <georg@python.org> | 2006-10-12 11:27:59 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-10-12 11:27:59 (GMT) |
commit | 2c1375c8db6d62128f594aec3820292576daff8b (patch) | |
tree | d9247df3a02819561d645310e7a153368689ddd9 /Lib/test | |
parent | 7d74a0e2874632393906becc0d8db20412431d72 (diff) | |
download | cpython-2c1375c8db6d62128f594aec3820292576daff8b.zip cpython-2c1375c8db6d62128f594aec3820292576daff8b.tar.gz cpython-2c1375c8db6d62128f594aec3820292576daff8b.tar.bz2 |
Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_builtin.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index f7cf811..72b6966 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -729,6 +729,11 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(ValueError, int, '123\0') self.assertRaises(ValueError, int, '53', 40) + # SF bug 1545497: embedded NULs were not detected with + # explicit base + self.assertRaises(ValueError, int, '123\0', 10) + self.assertRaises(ValueError, int, '123\x00 245', 20) + x = int('1' * 600) self.assert_(isinstance(x, long)) |