Another strange input handling error #1269

Closed
wesm opened this Issue Jan 15, 2012 · 5 comments

Projects

None yet

4 participants

@wesm
wesm commented Jan 15, 2012

Getting this both on 0.12 and git master

In [1]: baz = None

In [2]: timeit foo = baz.groupby(lambda x: x.split('#')[0])
  File "<magic-timeit>", line 6
    foo = baz.groupby(lambda x: x.split('
                                        ^
SyntaxError: EOL while scanning string literal
@takluyver
Member

I think this is due to the code trying to parse the command-line style syntax for magic functions. It has trouble when the argument to the magic command is Python code.

@ivanov
Member
ivanov commented Jan 15, 2012

I'm looking into this, just wrote a test of Wes' example. Here's a simpler (still failing) test: timeit ('#')
Narrowed it down to the posix=False flag of magic.py:1875 -- setting it to True doesn't cause this error.

This bug is related to #1109

@ivanov
Member
ivanov commented Jan 15, 2012

@wesm as temporary workaround, adding a space before '#' should allow you to continue to do timing

@fperez
Member
fperez commented Jan 16, 2012

Great, thanks @ivanov !

@ivanov ivanov added a commit to ivanov/ipython that referenced this issue Jan 18, 2012
@ivanov ivanov test for GH #1269 cb50110
@ivanov ivanov closed this in 84910f5 Jan 18, 2012
@wesm
wesm commented Jan 22, 2012

thanks guys

@minrk minrk added a commit to minrk/ipython that referenced this issue Jan 28, 2012
@ivanov @minrk ivanov + minrk test for GH #1269 5371b18
@minrk minrk added a commit to minrk/ipython that referenced this issue Jan 28, 2012
@ivanov @minrk ivanov + minrk shlex shouldn't parse out comments, closes #1269 7806cab
@ivanov ivanov added a commit that referenced this issue Apr 6, 2012
@ivanov @minrk ivanov + minrk test for GH #1269 6df2359
@yarikoptic yarikoptic pushed a commit to yarikoptic/ipython that referenced this issue May 2, 2014
@ivanov @minrk ivanov + minrk shlex shouldn't parse out comments, closes #1269 fdfde96
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@ivanov ivanov test for GH #1269 132ec14
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@ivanov ivanov shlex shouldn't parse out comments, closes #1269 fa83814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment