Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing when executing %debug print('m n') #8136

Open
vbraun opened this issue Mar 24, 2015 · 1 comment
Open

Incorrect parsing when executing %debug print('m n') #8136

vbraun opened this issue Mar 24, 2015 · 1 comment
Labels
Milestone

Comments

@vbraun
Copy link
Contributor

vbraun commented Mar 24, 2015

II ran into this issue with a more complicated command and distilled it to this testcase. Other print commands, for example %debug print('mn') without the space can be debugged. Also, any other function instead of print yields the same result:

$ sage -ipython
Python 2.7.8 (default, Feb 15 2015, 03:39:19) 
Type "copyright", "credits" or "license" for more information.

IPython 3.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: %debug print('m n')
NOTE: Enter 'c' at the ipdb>  prompt to continue execution.
---------------------------------------------------------------------------
SyntaxError                               Traceback (most recent call last)
SyntaxError: EOL while scanning string literal (<string>, line 1)
@takluyver
Copy link
Member

I think this is the collision of Python-style and shell style syntax. You can work around it by quoting the statement: %debug "print('m n')". It should be fixable, though, because %timeit print('m n') is OK.

@takluyver takluyver added the core label Mar 25, 2015
@takluyver takluyver added this to the wishlist milestone Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants