New submission from Raúl Núñez de Arenas:

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...

----------
assignee: docs@python
components: Documentation
messages: 260613
nosy: Raúl Núñez de Arenas, docs@python
priority: normal
severity: normal
status: open
title: Error in documentation for "compile" built-in function
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26401>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to