[New-bugs-announce] [issue20115] NUL bytes in commented lines

Armin Rigo report at bugs.python.org
Fri Jan 3 18:59:13 CET 2014


New submission from Armin Rigo:

This is probably the smallest example of a .py file that behaves differently in CPython vs PyPy, and for once, I'd argue that the CPython behavior is unexpected:

   # make the file:
   >>> open('x.py', 'wb').write('#\x00\na')

   # run it:
   python x.py

Expected: either some SyntaxError, or "NameError: global name 'a' is not defined".  Got: nothing.  It seems that CPython completely ignores the line that is immediately after a line with a '#' and a following '\x00'.

----------
components: Interpreter Core
messages: 207232
nosy: arigo
priority: low
severity: normal
status: open
title: NUL bytes in commented lines
type: compile error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20115>
_______________________________________


More information about the New-bugs-announce mailing list