Skip to content

Loading…

Irunner test failure #424

Closed
wants to merge 1 commit into from

3 participants

@jenshnielsen

When running the iptest I get a failure in test_irunner because the execution of "cos pi"
with autocall off now gives a syntax error and not a EOF error. This pull request fixes it.
However it is unclear why this is changed. For me the change happened when upgrading from
ubuntu10.10 to ubuntu11.04 (python2.6 to python2.). However in plain python shells I
get a syntax error in both 2.6 and 2.7 so I don't know how to properly fix this.

@takluyver
IPython: interactive computing in Python member

I'm also seeing this test fail on this. I wonder if it's to do with moving from Python 2.6 to 2.7.

Yes I also think it might. I see the test falling on ubuntu 11.04 (with python2.7) using a resent ipython 0.11dev and the test is
not failing on ubuntu 10.10 using python 2.6. However I always get the invalid syntax error if I try to run
"cos pi"
in ipython0.10.0 using python2.6 and when I use a standard python2.6 and 2.7 shell.

IPython: interactive computing in Python member

Interesting. I also started seeing it after upgrading Ubuntu. Do you want to make a pull request, to get other people testing it?

@takluyver
IPython: interactive computing in Python member

N.B. If we merge this, we should close issue #409.

@minrk
IPython: interactive computing in Python member

Yes, the error message is different in 2.7 and 2.6. Merging this will only make 2.7 pass, and 2.6 will then fail.

@takluyver
IPython: interactive computing in Python member

Wait until most testers are likely to be using 2.7, then merge? Add a decorator to skip it on Python 2.6 and below?

@minrk minrk referenced this pull request
Commit has since been removed from the repository and is no longer available.
@minrk minrk referenced this pull request
Commit has since been removed from the repository and is no longer available.
@minrk
IPython: interactive computing in Python member

It's trivial to allow both error messages, depending on Python version. See #427.

@jenshnielsen

Yes that is properly the right solution. However I wonder why Ipython0.11dev generates the
EOF error using python2.6 when Ipython0.10(python2.6) gives the syntax error and plain 2.6 and 2.7
also results in the syntax error. (I just tested this by running cos pi in various shells.)

@minrk minrk added a commit to minrk/ipython that referenced this pull request
@minrk minrk ensure ast.parse() gets code that ends with a newline
also fix an issue where irunner could send last newline after child exits, raising OSError

closes gh-409
closes gh-424
429dac2
@takluyver takluyver added a commit that closed this pull request
@takluyver takluyver Fix subtle bug with error message on Python 2.6 - code to be compiled…
… must end in a newline.

closes gh-409
closes gh-424
closes gh-427
closes gh-431
f02a1aa
@takluyver takluyver closed this in f02a1aa
@ellisonbg ellisonbg referenced this pull request
Commit has since been removed from the repository and is no longer available.
@damianavila damianavila referenced this pull request
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request
@takluyver takluyver Fix subtle bug with error message on Python 2.6 - code to be compiled…
… must end in a newline.

closes gh-409
closes gh-424
closes gh-427
closes gh-431
41f4aab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 7, 2011
  1. cos pi gives a syntax error when autocall is off.

    Jens Hedegaard Nielsen committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 IPython/lib/tests/test_irunner.py
View
2 IPython/lib/tests/test_irunner.py
@@ -108,7 +108,7 @@ def testIPython(self):
File "<ipython-input-8-586f1104ea44>", line 1
cos pi
^
-SyntaxError: unexpected EOF while parsing
+SyntaxError: invalid syntax
In [9]: cos(pi)
Something went wrong with that request. Please try again.