py-down-exception IPython issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
Most things work well, there are couple of strange things.
First, if you repeatedly press C-c - to go up the exception stack. With
regular Python, the cursor ends up jumping to line 1 of the file with
the exception and in the minibuffer it says: "Jumping to exception in
file <stdin> on line 1"; it might be better just to stay at the
outermost frame in the stack as line 1 might be a long way away. With
IPython the behaviour is a bit worse because the cursor in the *IPython*
buffer goes to the lines like
----> 1 demo1.f()
(This is for the demo1.py file I sent before and attached again.) And
Emacs opens a new buffer called "---->" which is a bit disconcerting.
It's worse if you use the universal argument to C-c =
For the same file I get a new buffer "----->" associated with the file
"/Users/
<module>()" which I guess comes from the IPython traceback lines:
In [5]: demo1.f()
Hello from f
Hello from g
Hello from h -- just before exception
-------
ZeroDivisionError Traceback (most recent call last)
/Users/
----> 1 demo1.f()
Secondly, the SyntaxError exceptions in the IPython buffer don't get
matched. Pressing C-c - does nothing with the following:
In [1]: import demo2
File "demo3.py", line 4
if a != 25
^
SyntaxError: invalid syntax
I'm afraid I don't understand exactly what you've done for the buffer switching and the way the string matching is now supposed to work, so I haven't been able to come up with a fix. Sorry.
One thing that would be very useful would be to limit the searching for exception reporting lines to the *last* set of exceptions. If you have a long Python or IPython session there will probably be several exceptions and pressing C-c - repeatedly, not only goes up the stack for the last exception, but then revisits the stack for the previous one, and so on until the beginning of the buffer is reached. I don't know if it's feasible to narrow the search just to the last exception.
Anyway, it's much, much better in it's current state than before. Many thanks.
Best,
Richard.
(Here are the demo files again, just in case.)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
milestone: | none → 6.0.5 |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Am 08.01.2012 15:32, schrieb Andreas Roehler: reverson/ projects/ edge/<ipython- input-1- b03658927958> in ------- ------- ------- ------- ------- ------- ------- ------- ------- ----- reverson/ projects/ edge/<ipython- input-5- 1cebb13502c5> in<module>()
> Public bug reported:
>
>
> Most things work well, there are couple of strange things.
>
> First, if you repeatedly press C-c - to go up the exception stack. With
> regular Python, the cursor ends up jumping to line 1 of the file with
> the exception and in the minibuffer it says: "Jumping to exception in
> file<stdin> on line 1"; it might be better just to stay at the
> outermost frame in the stack as line 1 might be a long way away. With
> IPython the behaviour is a bit worse because the cursor in the *IPython*
> buffer goes to the lines like
>
> ----> 1 demo1.f()
>
> (This is for the demo1.py file I sent before and attached again.) And
> Emacs opens a new buffer called "---->" which is a bit disconcerting.
> It's worse if you use the universal argument to C-c =
>
> For the same file I get a new buffer "----->" associated with the file
> "/Users/
> <module>()" which I guess comes from the IPython traceback lines:
>
> In [5]: demo1.f()
> Hello from f
> Hello from g
> Hello from h -- just before exception
> -------
> ZeroDivisionError Traceback (most recent call last)
> /Users/
> ----> 1 demo1.f()
>
>
> Secondly, the SyntaxError exceptions in the IPython buffer don't get
> matched. Pressing C-c - does nothing with the following:
>
> In [1]: import demo2
> File "demo3.py", line 4
> if a != 25
> ^
> SyntaxError: invalid syntax
>
>
> I'm afraid I don't understand exactly what you've done for the buffer switching and the way the string matching is now supposed to work, so I haven't been able to come up with a fix. Sorry.
>
>
> One thing that would be very useful would be to limit the searching for exception reporting lines to the *last* set of exceptions. If you have a long Python or IPython session there will probably be several exceptions and pressing C-c - repeatedly, not only goes up the stack for the last exception, but then revisits the stack for the previous one, and so on until the beginning of the buffer is reached. I don't know if it's feasible to narrow the search just to the last exception.
>
>
> Anyway, it's much, much better in it's current state than before. Many thanks.
>
> Best,
> Richard.
>
>
better now?
Thanks for the excellent examples BTW
cheers,
Andreas