Message11119

Author jamesmudd
Recipients fwierzbicki, jamesmudd, ldias, pradeeppanayal, zyasoft
Date 2017-02-23.20:38:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487882314.16.0.150670318861.issue2466@psf.upfronthosting.co.za>
In-reply-to
Content
Could you provide more details on which version of Jython does it fail?

I have just tried this on master and it appears to work almost correctly. Jython returns the correct SyntaxError, with a slightly different message to CPython and the ^ highlighting the position of the error is wrong.

Jython 2.7.1b3 (, Feb 23 2017, 20:19:21) 
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> print "some text
  File "<stdin>", line 1
    print "some text
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> print 'some text
  File "<stdin>", line 1
    print 'some text
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> print 'some data
  File "<stdin>", line 1
    print 'some data
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> exec('def foo():\n    return "bar\n')
>>> exec('a = "bar\n')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    a = "bar
     ^
SyntaxError: no viable alternative at input '='
>>> 

The only example which actually failed for me (by which I mean incorrectly suceeded) was "exec('def foo():\n    return "bar\n')" where no SyntaxError was raised. I will have a look at that one
History
Date User Action Args
2017-02-23 20:38:34jamesmuddsetmessageid: <1487882314.16.0.150670318861.issue2466@psf.upfronthosting.co.za>
2017-02-23 20:38:34jamesmuddsetrecipients: + jamesmudd, fwierzbicki, zyasoft, pradeeppanayal, ldias
2017-02-23 20:38:34jamesmuddlinkissue2466 messages
2017-02-23 20:38:33jamesmuddcreate