Issue1136

classification
Title: Parsing a module fails if it ends with whitespace but no newline
Type: Severity: normal
Components: Core Versions: 2.5alpha3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pekka.klarck, yanne, zyasoft
Priority: Keywords:

Created on 2008-09-23.10:55:04 by yanne, last changed 2008-10-11.03:26:44 by zyasoft.

Messages
msg3612 (view) Author: Janne Härkönen (yanne) Date: 2008-09-23.10:55:03
$ echo -en "print 'Hello'\n  " > test.py
$ /opt/jython2.5a3/jython test.py
Traceback (most recent call last):
  (no code object) at line 0
  File "test.py", line 2

         ^
SyntaxError: line 2:2 mismatched input '' expecting EOF (test.py, line 2)

$ echo -en "def hello():\n    print 'Hello'\n " > test.py
$ /opt/jython2.5a3/jython test.py
Traceback (most recent call last):
  (no code object) at line 0
  File "test.py", line 3

        ^
IndentationError: unindent does not match any outer indentation level
(test.py, line 3)

$ echo -en "class Foo:\n  def hello(self):\n    print 'Hello'\n  " > test.py
$ /opt/jython2.5a3/jython test.py
Traceback (most recent call last):
  (no code object) at line 0
  File "test.py", line 4

         ^
SyntaxError: line 4:2 mismatched input '' expecting DEDENT (test.py, line 4)
msg3653 (view) Author: Jim Baker (zyasoft) Date: 2008-10-11.03:26:44
Resolved by r5339 and tested by test_eof_jy.py
This was also occurring in Django
History
Date User Action Args
2008-10-11 03:26:44zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg3653
nosy: + zyasoft
2008-09-24 23:13:20pekka.klarcksetnosy: + pekka.klarck
2008-09-23 10:55:04yannecreate