Author Raúl Núñez de Arenas
Recipients Raúl Núñez de Arenas, docs@python
Date 2016-02-21.15:35:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456068943.64.0.547733660691.issue26401@psf.upfronthosting.co.za>
In-reply-to
Content
According to the documentation, if the 'compile' built-in function encounters NUL bytes in the compiled source, it raises TypeError, but this is not true:

>>> source = '\u0000'
>>> compile(source, '', 'single')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: source code string cannot contain null bytes

It raises ValueError, not TypeError. And IMHO, it's the proper exception to raise...
History
Date User Action Args
2016-02-21 15:35:43Raúl Núñez de Arenassetrecipients: + Raúl Núñez de Arenas, docs@python
2016-02-21 15:35:43Raúl Núñez de Arenassetmessageid: <1456068943.64.0.547733660691.issue26401@psf.upfronthosting.co.za>
2016-02-21 15:35:43Raúl Núñez de Arenaslinkissue26401 messages
2016-02-21 15:35:43Raúl Núñez de Arenascreate