Skip to content
This repository

Qt Console output spacing #2082

Closed
bfroehle opened this Issue July 02, 2012 · 7 comments

3 participants

Bradley M. Froehle Matthias Bussonnier Fernando Perez
Bradley M. Froehle
Collaborator

In IPython (=0.13) Qt Console, there seems to be a missing newline before the Out parameter in the first plot command after running pylab. See, for example In [2] and Out[2]:

Python 2.7.3 (default, Apr 20 2012, 22:39:59) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13 -- 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.
%guiref   -> A brief reference about the graphical user interface.

In [1]: pylab

Welcome to pylab, a matplotlib-based Python environment [backend: TkAgg].
For more information, type 'help(pylab)'.

In [2]: plot([1,2,3])Out[2]: [<matplotlib.lines.Line2D at 0x3e40210>]

In [3]: plot([1,2,3])
Out[3]: [<matplotlib.lines.Line2D at 0x3e34d10>]

In [4]: 
Bradley M. Froehle
Collaborator

git bisect points the origin of the issue to 1422d27, but I haven't investigated further.

1422d277055ed26b7a367e6ce2c1649d32548ee9 is the first bad commit
commit 1422d277055ed26b7a367e6ce2c1649d32548ee9
Author: Matthias BUSSONNIER <bussonniermatthias@gmail.com>
Date:   Fri May 25 17:15:55 2012 +0200

    new completer for qtconsole.

    add a completer to the qtconsole that is navigable by arraow keys and
    tab. One need to call it twice to get it on focus and be able to select
    completion with Return. looks like zsh completer, not the gui drop down
    list of --gui-completer.

    This also try to split the completion logic from console_widget, and try
    to keep the old completer qui around. The plain completer that never
    takes focus back, and the QlistWidget completer.

    to switch between the 3, the --gui-completion flag as been changed to
    take an argument (plain, droplist, ncurses).

Fernando Perez
Owner
fperez commented July 02, 2012

Confirming, though I see slightly different behavior: I simply don't see the first Out after plotting for the first time. This is what it looks like to me:

In [1]: pylab

Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].
For more information, type 'help(pylab)'.

In [2]: plot([1,2,3,4])

In [3]: plot([1,2,3,4])
Out[3]: [<matplotlib.lines.Line2D at 0x30a6490>]

In any case, bug indeed. Bummer.

Matthias Bussonnier
Collaborator

hum.. I know a commit of mine introduced the bug, but i'll have difficulty tracking it down as I can't reproduce it...
Does invoking the completer once (plo<tab>..) change the behavior ?

Fernando Perez
Owner
fperez commented July 04, 2012

No @Carreau, I get the same thing even if I invoke the completer. Do you not see any problem at all?

Matthias Bussonnier
Collaborator

No, I don't get it at all. On neither of my 2 computers.
I don't see any reason why it should do that, except a race condition in PyQt/PySide event handeling that erase the temporary buffer after a newline is printed, but even thought, the buffer is zero len, so it should not do this, and the clearing of the buffer is not made by bindings event...

I'm thinking on what can be done.
I would try do make _clear_temporary_buffer no-op in IPython/frontend/qt/console/console_widget.py, (be carefull not to use the completer) and try again. Also look at wether or not the old completer (--gui-completion=plain) does the same.

i'll see if I can get this behavior on a VM...

Matthias Bussonnier Carreau referenced this issue from a commit July 05, 2012
Commit has since been removed from the repository and is no longer available.
Matthias Bussonnier Carreau referenced this issue from a commit July 05, 2012
Commit has since been removed from the repository and is no longer available.
Matthias Bussonnier
Collaborator

Did reproduce it on a linux VM, @fperez, @bfroehle could you try #2101 to see if it works on both your cases ?

Bradley M. Froehle
Collaborator

Yes, works for me.

Matthias Bussonnier Carreau closed this in dd5f651 July 05, 2012
Matthias Bussonnier Carreau referenced this issue from a commit in Carreau/ipython July 05, 2012
Matthias Bussonnier fix completer deletting newline
fixes #2082

backported to 0.13.1 from PR #2101
d3bda82
Min RK minrk referenced this issue from a commit July 21, 2012
Commit has since been removed from the repository and is no longer available.
Min RK minrk referenced this issue from a commit July 21, 2012
Min RK Backport PR #2101: fix completer deletting newline
should fixes #2082

do not forget to backport to 0.13.1
a784e32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.