py-down-exception IPython 0.12 bug

Bug #914607 reported by Andreas Roehler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

 If
> you use C-c - to go all the way to the top of the stack trace (in
> IPython), you can't use C-c = to come back down again unless you first
> move the cursor in the *IPython* buffer down a line from the
> "/Users/reverson/projects/edge/<ipython-input-2-1cebb13502c5> in
> <module>()" line --- pressing C-c = just gives a message "Bottom of
> traceback". This works fine with plain Python, but I can't see
> precisely what's causing it.

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.5
importance: Undecided → Medium
Changed in python-mode:
status: New → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi Richard,

can't reproduce with examples available.

Could you send some more detailed description?

thanks,

Andreas

Revision history for this message
Richard Everson (r-m-everson) wrote : Re: [Bug 914607] Re: py-down-exception IPython bug

Hi Andreas,

What I did is:

1. Open demo1.py
2. Start ipython (C-c ! for me, or M-x ipython).
3. In the *Ipython* buffer
In [1]: import demo1

In [2]: demo1.f()
Hello from f
Hello from g
Hello from h -- just before exception
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/Users/reverson/projects/edge/<ipython-input-2-1cebb13502c5> in <module>()
----> 1 demo1.f()

/Users/reverson/projects/edge/demo1.pyc in f()
      2 def f():
      3 print 'Hello from f'
----> 4 g()
      5
      6 def g():

/Users/reverson/projects/edge/demo1.pyc in g()
      6 def g():
      7 print 'Hello from g'
----> 8 h()
      9
     10 def h():

/Users/reverson/projects/edge/demo1.pyc in h()
     10 def h():
     11 print 'Hello from h -- just before exception'
---> 12 1.0/0.0

ZeroDivisionError: float division by zero

4. Press C-c - repeatedly to go up the stack (beautiful!) until the top of the stack is reached. At this point the cursor in my *IPython* buffer is on the "/Users/reverson/projects/edge/<ipython-input-2-1cebb13502c5> in <module>()" line and I get "Top of traceback" in the minibuffer.

5. Press C-c = to go back down the stack. Here's problem: nothing happens except "Bottom of traceback" in the mb. With standard Python, C-c = takes you back down the stack trace.

6. (Diagnostic) If you move the cursor in the *IPython* buffer to the next line down ("----> 1 demo1.f()") or further down, then C-c = correctly takes you down the stack trace.

Hope this makes sense.
Best,
Richard.

On 11 Jan 2012, at 09:45, Andreas Roehler wrote:

> Hi Richard,
>
> can't reproduce with examples available.
>
> Could you send some more detailed description?
>
> thanks,
>
> Andreas
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/914607
>
> Title:
> py-down-exception IPython bug
>
> Status in An Emacs mode for editing Python code:
> In Progress
>
> Bug description:
>
> If
>> you use C-c - to go all the way to the top of the stack trace (in
>> IPython), you can't use C-c = to come back down again unless you first
>> move the cursor in the *IPython* buffer down a line from the
>> "/Users/reverson/projects/edge/<ipython-input-2-1cebb13502c5> in
>> <module>()" line --- pressing C-c = just gives a message "Bottom of
>> traceback". This works fine with plain Python, but I can't see
>> precisely what's causing it.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/python-mode/+bug/914607/+subscriptions

summary: - py-down-exception IPython bug
+ py-down-exception IPython 0.12 bug
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi Richard,

thanks again sending that nice examples.

Should be fixed now - cursor must stay onto exception, not at file-name.

BTW have a look a new `py-shell-name' features...

cheers,

Andreas

Revision history for this message
Richard Everson (r-m-everson) wrote : Re: [Bug 914607] Re: py-down-exception IPython 0.12 bug

Hi Andreas,

> thanks again sending that nice examples.

No problem; thanks for putting so much effort into fixing it.

> Should be fixed now - cursor must stay onto exception, not at file-name.

Yes, works beautifully for me.

> BTW have a look a new `py-shell-name' features…

Very useful!

Here's a little addition that makes customisation a bit easier -- I got fed up with Customize->Programming->Languages->Python

$ bzr diff -p1
=== modified file 'python-mode.el'
--- old/python-mode.el 2012-01-12 13:31:48 +0000
+++ new/python-mode.el 2012-01-12 14:35:36 +0000
@@ -1271,7 +1271,11 @@
         ["Find function" py-find-function
          :help "Try to find source definition of function at point"]
         ["Update imports" py-update-imports
- :help "Update list of top-level imports for completion"]))
+ :help "Update list of top-level imports for completion"]
+ "-"
+ ["Customize Python mode" (customize-group 'python)
+ :help "Open the customization buffer for Python"]
+ ))
     map))
 ;; Fixme: add toolbar stuff for useful things like symbol help, send
 ;; region, at least. (Shouldn't be specific to Python, obviously.)

Best,
Richard.

Revision history for this message
Andreas Roehler (a-roehler) wrote : python-mode customization group

Hi Barry, hi all,

after implementing the patch below --thanks Richard--
found that mixture of python-mode.el and python.el customization slots
confusing.

After introducing a python-mode customization group it looks much better.

Will commit it next, so you may have a look.

Cheers,

Andreas

Am 12.01.2012 15:41, schrieb Richard Everson:
> Here's a little addition that makes customisation a bit easier -- I got
> fed up with Customize->Programming->Languages->Python
>
>
> $ bzr diff -p1
> === modified file 'python-mode.el'
> --- old/python-mode.el 2012-01-12 13:31:48 +0000
> +++ new/python-mode.el 2012-01-12 14:35:36 +0000
> @@ -1271,7 +1271,11 @@
> ["Find function" py-find-function
> :help "Try to find source definition of function at point"]
> ["Update imports" py-update-imports
> - :help "Update list of top-level imports for completion"]))
> + :help "Update list of top-level imports for completion"]
> + "-"
> + ["Customize Python mode" (customize-group 'python)
> + :help "Open the customization buffer for Python"]
> + ))
> map))
> ;; Fixme: add toolbar stuff for useful things like symbol help, send
> ;; region, at least. (Shouldn't be specific to Python, obviously.)
>
>
> Best,
> Richard.

Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.