diff options
author | Georg Brandl <georg@python.org> | 2006-10-12 11:28:04 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-10-12 11:28:04 (GMT) |
commit | dd4c398c27382502ba514705b69ed1ec72ed9755 (patch) | |
tree | 71677faaa97fe5ac41e38ef1ff3a1a44ee7392cb /Lib | |
parent | b85509d5ef5acbe5959383a1007335ad5b7aa786 (diff) | |
download | cpython-dd4c398c27382502ba514705b69ed1ec72ed9755.zip cpython-dd4c398c27382502ba514705b69ed1ec72ed9755.tar.gz cpython-dd4c398c27382502ba514705b69ed1ec72ed9755.tar.bz2 |
Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
(backport from rev. 52305)
Diffstat (limited to 'Lib')
-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)) |