Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[qtconsole] %hist doesn't show anything in qtconsole #617

Closed
reckoner opened this Issue · 21 comments

5 participants

@reckoner

I have built rc2 on Windows XP and while the qtconsole works fine for the most part, %hist does not show any history in the qtconsole.

@takluyver
Owner

A bare %hist will show history from the start of the session, so be sure you've entered a few commands before trying it.

Does it produce any output after you type %hist? Any error messages? Do you get the next prompt? If you start ipython qtconsole (or whatever the command is in Windows) from a command prompt, do you get any error messages there? Does %hist still work in terminal IPython?

@reckoner
@takluyver
Owner
@minrk
Owner
@takluyver
Owner

OK, looking at the code, it looks like it's happening an all cases on Windows where pyreadline is in use. I think the ZMQshell should have readline_use default to False (which will also speed up launching it a bit). Pull request coming up.

@takluyver
Owner

@reckoner: Can you try my i617 branch from here: https://github.com/takluyver/ipython/tree/i617

It may raise further problems, but I've just tested it here, and it doesn't obviously go wrong.

@reckoner
@takluyver
Owner
git remote add takluyver git://github.com/takluyver/ipython.git
git fetch takluyver
git checkout i617

That should do it. I install in a virtualenv for testing, but you can run the source however you want, so long as it's definitely importing the correct modules.

@reckoner
@takluyver
Owner

OK, great. -g doesn't automatically number the items, although it probably should. I'll tweak that.

Assuming you're working from a clone of the main codebase, git checkout master should take you back to the main branch.

@reckoner
@takluyver
Owner

The numbering would already happen if you use %hist -ng pattern (n for numbers). I've updated my i617 branch so that -g implies -n as well. See also Pull request #618.

@fperez
Owner
@takluyver
Owner

@fperez: If you're replying by email, do click through and read the intervening discussion. We've tracked it down to a problem related to pyreadline, and I've got a fix that apparently works (PR #618).

@fperez
Owner

Oops, sorry :) I forgot gh only sends the first email...

@takluyver
Owner

Closed by ff5e7cd.

@takluyver takluyver closed this
@fperez fperez reopened this
@fperez
Owner

Hi folks, I'm afraid I have to reopen this, because I'm effectively going to revert b641eb6. Unfortunately it caused %run to break in the Qt console with this error:

In [1]: run ~/scratch/error.py
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/fperez/ipython/ipython/tools/ in ()
----> 1 get_ipython().magic(u"run ~/scratch/error.py")

/home/fperez/usr/lib/python2.6/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s, next_input)
   1892                 self._magic_locals = sys._getframe(1).f_locals
   1893             with self.builtin_trap:
-> 1894                 result = fn(magic_args)
   1895             # Ensure we're not keeping object references around:
   1896             self._magic_locals = {}

/home/fperez/usr/lib/python2.6/site-packages/IPython/core/magic.pyc in magic_run(self, parameter_s, runner, file_finder)
   1634         try:
   1635             stats = None
-> 1636             with self.readline_no_record:
   1637                 if opts.has_key('p'):
   1638                     stats = self.magic_prun('',0,opts,arg_lst,prog_ns)

AttributeError: 'ZMQInteractiveShell' object has no attribute 'readline_no_record'

but even if I try to make an 'empty' context manager to play the role of readliine_no_record, then syntax highlighting is broken. I simply don't have time right now to go into deep debugging right prior to a release.

This is why, even the most innocent-looking changes, should never be made between an RC and a final release. It was by pure accident that I caught the problem, and since we don't have any way to automatically test the magics from the Qt console, we'd only have seen this after an embarrassing public release.

@fperez fperez closed this issue from a commit
@fperez fperez Revert commit that fixed gh-617 as it broke %run in the Qt console.
Unfortunately b641eb6 caused %run to
stop working in the Qt console, so for now we must disable it (too
close to a release).  See gh-617 for further details, and restore once
the other issues have been addressed.
fe44943
@fperez fperez closed this in fe44943
@takluyver
Owner

Ouch, well spotted. Your commit message seems to have automatically closed it again, so I'll re-reopen it.

@takluyver takluyver reopened this
@epatters epatters closed this issue from a commit
epatters BUG: Don't use readline in the ZMQShell.
Closes gh-617.
14ae4c0
@epatters epatters closed this in 14ae4c0
@fperez
Owner

OK, it looks like we finally got this one. If anyone stlll sees problems on win32 please let us know and reopen, but now it looks like we have a good solution.

@reckoner
@fperez
Owner

Glad to hear that, thanks for confirming the fix worked indeed.

@fperez fperez referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@ellisonbg ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
This was referenced
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@fperez fperez Revert commit that fixed gh-617 as it broke %run in the Qt console.
Unfortunately b641eb6 caused %run to
stop working in the Qt console, so for now we must disable it (too
close to a release).  See gh-617 for further details, and restore once
the other issues have been addressed.
5b2bcd1
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
epatters BUG: Don't use readline in the ZMQShell.
Closes gh-617.
bec8f24
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.