Title: continuation lines fail in interactive interpreter
Type: behaviour Severity: normal
Components: Core Versions: 2.5.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: funkychocobo, fwierzbicki, undefined
Priority: normal Keywords:

Created on 2009-06-03.17:43:43 by undefined, last changed 2009-09-04.04:06:37 by funkychocobo.

File name Uploaded Description Edit Remove undefined, 2009-06-03.17:43:42 example from python 2.5 official tutorial of line continuations using \n
msg4787 (view) Author: (undefined) Date: 2009-06-03.17:43:40
this was reported as an addendum to issue 1354 where the original issue
was resolved, but this specific issue wasn't.

Jython 2.5rc3+ (trunk:6440, Jun 3 2009, 16:56:43) 
[OpenJDK Client VM (Sun Microsystems Inc.)] on java1.6.0_0

$ jython/dist/bin/jython
This is a rather long string containing
several lines of text just as you would do in C.
    Note that whitespace at the beginning of the line is significant.

$ jython/dist/bin/jython <
  File "<stdin>", line 2
SyntaxError: mismatched character '<EOF>' expecting '"'
  File "<stdin>", line 1
    several lines of text just as you would do in C.\n\
SyntaxError: mismatched character 'n' expecting '\n'
  File "<stdin>", line 0
SyntaxError: unexpected character after line continuation character
  File "<stdin>", line 1
SyntaxError: no viable alternative at character '\n'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'hello' is not defined

NOTE: same thing happens when typing the text into the interactive
interpreter, but it's easier to demonstrated reading the text on stdin
from a file.

i presume this is a parser problem like issue 1354 since the problem is
only seen when parsing input from the interactive interpreter.
msg4789 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-06-03.18:52:30
woops thought I had that one fixed
msg4790 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-06-03.23:47:57
I've confirmed this bug.  It is nasty enough that it may involve some
redesign of the lexer (or creating a separate lexer for PartialParser).
 Since this only happens for interactive mode I think it does not have
to block 2.5.0, but should get addressed for 2.5.1.
msg4884 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-07-06.13:53:20
Fixed in r6512
msg5098 (view) Author: JasonWickers (funkychocobo) Date: 2009-09-04.04:06:36
Using 2.5.1rc1, copy (or type) the following code on windows 32 using 
jre 1.6.0_14 into the interactive console:

for i in range(ITER):
   chain = Chain(40)
   end = time.time()

What i get is a never ending console that won't let me end the for 

Or effectively the output (note the extra ...'s are me hitting return 
repeatedly hoping for the for loop to eventually end being defined):
>>> for i in range(ITER):
...    chain = Chain(40)
...    chain.kill(3)
... end = time.time()
Date User Action Args
2009-09-04 04:06:37funkychocobosetnosy: + funkychocobo
messages: + msg5098
2009-07-06 13:53:33fwierzbickisetstatus: open -> closed
resolution: accepted -> fixed
2009-07-06 13:53:21fwierzbickisetmessages: + msg4884
versions: + 2.5.0, - 25rc4
2009-06-03 23:47:58fwierzbickisetpriority: normal
resolution: accepted
messages: + msg4790
2009-06-03 18:52:30fwierzbickisetassignee: fwierzbicki
messages: + msg4789
nosy: + fwierzbicki
2009-06-03 17:43:43undefinedcreate