mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
This commit is contained in:
parent
7d74a0e287
commit
2c1375c8db
3 changed files with 27 additions and 2 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue