Message11120

Author pradeeppanayal
Recipients fwierzbicki, jamesmudd, ldias, pradeeppanayal, zyasoft
Date 2017-02-24.05:06:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAOLSt9EiHVgM7y8Uq8GPPrL2BhJXPiaJeuf1mS+xyy5m8GYF9g@mail.gmail.com>
In-reply-to <1487882314.16.0.150670318861.issue2466@psf.upfronthosting.co.za>
Content
I am using 2.7.0 stand alone jar. Maven,

<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.7.0</version>
</dependency>

I was using a different version of jython (2.5.3) when I posted that issue.
The issue is still exist in 2.7.0 also.
Test cases,

   - print 'test   -> Failed (No resp and error)
   - print "test'  -> Failed
   - print 'test"  -> Failed
   - print 'test"\nprint 'some valid' -> Success (Getting syntax error)
   - print 'test"\nprint 'some invalid" -> Success (Getting syntax error)

Hope this may help you.

You people had done a great job by implementing this tool. It's really
magical.

Thanks & Regards,
*Pradeep CH*
*+91-7708336299 *

On Fri, Feb 24, 2017 at 2:08 AM, James Mudd <report@bugs.jython.org> wrote:

>
> James Mudd added the comment:
>
> 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
>
> ----------
> nosy: +jamesmudd
>
> _______________________________________
> Jython tracker <report@bugs.jython.org>
> <http://bugs.jython.org/issue2466>
> _______________________________________
>
Files
File name Uploaded
unnamed pradeeppanayal, 2017-02-24.05:06:13
History
Date User Action Args
2017-02-24 05:06:14pradeeppanayalsetrecipients: + pradeeppanayal, fwierzbicki, zyasoft, jamesmudd, ldias
2017-02-24 05:06:14pradeeppanayallinkissue2466 messages
2017-02-24 05:06:14pradeeppanayalcreate