Terry J. Reedy added the comment: How lovely ;-)
>>> compile(chr(0), '', 'eval') # 2.7, chr(0) is byte Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> compile(chr(0), '', 'eval') TypeError: compile() expected string without null bytes >>> compile(chr(0), '', 'eval') # 3.4, chr(0) is unichar Traceback (most recent call last): File "<pyshell#25>", line 1, in <module> compile(chr(0), '', 'eval') ValueError: source code string cannot contain null bytes >>> compile(bytes(1), '', 'eval') # == 2.7 chr(0) Traceback (most recent call last): File "<pyshell#27>", line 1, in <module> compile(bytes(1), '', 'eval') ValueError: source code string cannot contain null bytes I almost think the long tuple should be replaced by Exception. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25733> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com