It looks like the issue was already fixed in Python 3:
Python 3.5.0a0 (default:61d9aa8be445, May 20 2014, 16:03:51)
>>> int('a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: 'a'
>>> int('\0a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '\x00a'
>>> int('abc\x00def')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: 'abc\x00def'
And the last one:
>>> int('\0')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '\x00' |