Skip to content
This repository

"RuntimeError: Cannot change input buffer during execution" in console_widget.py #500

Closed
mspacek opened this Issue June 02, 2011 · 1 comment

2 participants

Martin Spacek Evan Patterson
Martin Spacek

Not sure what the sequence of events is, and I can't reproduce it reliably, but I've had this happen several times with ipython-qtconsole.

I type something, maybe a function name (say gca()), the call tip comes up, I hit ESC to clear it, then hit TAB to list the attribs, then ESC again, and so on. Maybe I plot something at some point, and then close it.

Sometimes, I get to the point where the cursor disappears, and the console doesn't respond to the keyboard. In my own app that embeds the (Rich)IPythonWidget, I can still access the menu and toolbar. Here's the associated error:

Traceback (most recent call last):
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/console_widget.py", line 225, in eventFilter
    return self._event_filter_console_keypress(event)
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/frontend_widget.py", line 270, in _event_filter_console_keypress
    return super(FrontendWidget, self)._event_filter_console_keypress(event)
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/console_widget.py", line 1041, in _event_filter_console_keypress
    self._keyboard_quit()
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/console_widget.py", line 1510, in _keyboard_quit
    self.input_buffer = ''
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/console_widget.py", line 490, in _set_input_buffer
    raise RuntimeError("Cannot change input buffer during execution.")
RuntimeError: Cannot change input buffer during execution.

I suppose this means the kernel is busy doing something it shouldn't be. Perhaps this is related to #499.

I have to close the console, and when I do, it seems to close cleanly. I'll try and reproduce this more reliably and report back.

Evan Patterson
Collaborator

Due to fixes I made a while ago (I can't find the commit), it is no longer possible for this exception to be raised.

Thanks for the report.

Evan Patterson epatters closed this August 18, 2011
Damián Avila damianavila referenced this issue from a commit July 30, 2013
Commit has since been removed from the repository and is no longer available.
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.