This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients ppperry, terry.reedy
Date 2015-11-27.21:09:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448658577.58.0.89826086354.issue25733@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-11-27 21:09:37terry.reedysetrecipients: + terry.reedy, ppperry
2015-11-27 21:09:37terry.reedysetmessageid: <1448658577.58.0.89826086354.issue25733@psf.upfronthosting.co.za>
2015-11-27 21:09:37terry.reedylinkissue25733 messages
2015-11-27 21:09:37terry.reedycreate