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

run -d message unclear #3464

Closed
mhearne-usgs opened this issue Jun 24, 2013 · 8 comments · Fixed by #3575
Closed

run -d message unclear #3464

mhearne-usgs opened this issue Jun 24, 2013 · 8 comments · Fixed by #3575
Milestone

Comments

@mhearne-usgs
Copy link

Prior to 1.0.dev, (0.12.1), I had to hit 'c' to start the script:

IPython 0.12.1 -- 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]: run -d foo.py
ERROR: File `u'foo.py'` not found.
In [2]: pwd
Out[2]: u'/Users/mhearne/src/python/scipy2013/ipython/ipython-in-depth/notebooks/figs'

In [3]: cd /Users/mhearne/src/python
/Users/mhearne/src/python

In [4]: run -d foo.
foo.py   foo.pyc  

In [4]: run -d foo.py
*** Blank or comment
*** Blank or comment
Breakpoint 1 at /Users/mhearne/src/python/foo.py:3
NOTE: Enter 'c' at the ipdb>  prompt to start your script.
> <string>(1)<module>()

ipdb> c
> /Users/mhearne/src/python/foo.py(3)<module>()
      2 
1---> 3 x = 1
      4 print 'hello world'

With 1.0.dev, it behaves like this ('c' not required):

In [1]: !cat foo.py
#!/usr/bin/env python

x = 1
print 'hello world'


In [2]: run -d foo
foo.py     foo/       foolog.py  

In [2]: run -d foo.p
foo.py   foo.pyc  

In [2]: run -d foo.py
*** Blank or comment
*** Blank or comment
*** Blank or comment
NOTE: Enter 'c' at the ipdb>  prompt to start your script.
> /Users/mhearne/src/python/foo.py(3)<module>()
      2 
----> 3 x = 1
      4 print 'hello world'

If this is the intended behavior, I suggest removing the misleading message.

Looks like @tkf implemented this change, @ivanov said to mention him.

@minrk
Copy link
Member

minrk commented Jul 6, 2013

I'm confused here - In IPython 1.0, I have to press 'c' in an ipdb > prompt before the script executes, just like the message says. What's different?

@mhearne-usgs
Copy link
Author

My platform info:
Mac OS 10.7.5
Python 2.7.3 (Enthought Canopy 1.0.3)
IPython 1.0.dev

I do NOT have to press 'c' to start the script, as I did before, or, apparently, as you still do. @ivanov witnessed the behavior on my Mac at SciPy.

@ivanov looked through the changelog, and said he found a change in that section of the code that looked like it was implemented by @tkf.

@minrk
Copy link
Member

minrk commented Jul 6, 2013

Interesting. What do you get with

from IPython.core.debugger import OldPdb
print OldPdb

?

@mhearne-usgs
Copy link
Author

In [1]: from IPython.core.debugger import OldPdb

In [2]: print OldPdb
pdb.Pdb

@minrk
Copy link
Member

minrk commented Jul 6, 2013

Just to confirm, if you don't press c, you still see the output hello world? I don't see that in what you pasted.

@mhearne-usgs
Copy link
Author

If I run a script with run -d, I used to be required to hit 'c' to start debugging the script. Now I'm debugging the script without hitting 'c', and if I do hit 'c', it runs the program to completion. This behavior is actually ok with me, since I never understood why I had to hit another key after "run -d". However, although the prompt at the top tells me that hitting 'c' will start my script, it actually finishes it.

IPython session pasted below:

In [1]: more hello.py
#!/usr/bin/env python

print 'hello world.'

In [2]: run -d hello.py
*** Blank or comment
*** Blank or comment
*** Blank or comment
NOTE: Enter 'c' at the ipdb> prompt to start your script.

/Users/mhearne/src/python/hello.py(3)()
1 #!/usr/bin/env python
2
----> 3 print 'hello world.'

ipdb> c
hello world.

@minrk
Copy link
Member

minrk commented Jul 6, 2013

Not really, it just starts it - no statements have been run until you hit 'c'. The only difference seems to be that 1.0 skips over no-op lines, while 0.12 requires one extra 'c' to get started (thus two before a single line of code is executed).

It is also not generally true that it "finishes" the script, because it will stop to debug at any breakpoints or exceptions. It only runs to completion in this case because there is no bug to "de-".

Would changing "start your script" to "proceed with execution" be satisfactory?

@mhearne-usgs
Copy link
Author

Sure - if the documentation matches the implementation, then I'm almost always happy. Plus, as I said, I actually prefer the current behavior - I just need to keep my fingers from reflexively hitting 'c' all the time :)

minrk added a commit to minrk/ipython that referenced this issue Jul 7, 2013
clarify any ambiguity with 'start'.

closes ipython#3464
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
clarify any ambiguity with 'start'.

closes ipython#3464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants