Skip to content

Fix PyQt5 ctrl-c handling issue introduced by input hook refactoring (pull #5666) #6804

Closed

Description

@erikhvatum

PyQt5 frontiersman, here. On OS X, Linux, and Windows with PyQt5, I have to revert out commit d8c13f5. If I leave this commit in, issuing ctrl-c after doing from PyQt5 import Qt; %gui qt causes the interpreter to exit:

(control C pressed here)

In [4]: Traceback (most recent call last):
File "/Users/ehvatum/Desktop/ipython_git/IPython/lib/inputhookqt4.py", line 123, in inputhook_qt4
event_loop.exec_()
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 277, in 'calling callback function'
File "/Users/ehvatum/Desktop/ipython_git/IPython/lib/inputhookqt4.py", line 130, in inputhook_qt4
mgr.clear_inputhook()
AttributeError: 'Qt4InputHook' object has no attribute 'clear_inputhook'

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

Traceback (most recent call last):
File "/usr/local/bin/ipython", line 9, in
load_entry_point('ipython==3.0.0-dev', 'console_scripts', 'ipython')()
File "/Users/ehvatum/Desktop/ipython_git/IPython/init.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/Users/ehvatum/Desktop/ipython_git/IPython/config/application.py", line 549, in launch_instance
app.start()
File "/Users/ehvatum/Desktop/ipython_git/IPython/terminal/ipapp.py", line 372, in start
self.shell.mainloop()
File "/Users/ehvatum/Desktop/ipython_git/IPython/terminal/interactiveshell.py", line 383, in mainloop
self.interact(display_banner=display_banner)
File "/Users/ehvatum/Desktop/ipython_git/IPython/terminal/interactiveshell.py", line 446, in interact
self.hooks.pre_prompt_hook()
File "/Users/ehvatum/Desktop/ipython_git/IPython/core/hooks.py", line 137, in call
return cmd(*args, **kw)
File "/Users/ehvatum/Desktop/ipython_git/IPython/lib/inputhookqt4.py", line 174, in preprompthook_qt4
mgr.set_inputhook(inputhook_qt4)
AttributeError: 'Qt4InputHook' object has no attribute 'set_inputhook'

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

The above is from OS X, but the errors seen on Windows and Linux are the same (flowing from AttributeError: 'Qt4InputHook' object has no attribute 'set_inputhook').

Activity

  1. added a commit that references this issue on Oct 28, 2014
    29a0deb
  2. takluyver commented on Oct 28, 2014

    @takluyver
    Member

    Thanks. #6804 should resolve this.

  3. erikhvatum commented on Oct 28, 2014

    @erikhvatum
    ContributorAuthor

    Thank you! It's super gratifying seeing an issue I reported fixed in such short order.

  4. takluyver commented on Oct 28, 2014

    @takluyver
    Member

    You're welcome. I suspected from the traceback that it would be quite an easy fix, and it's always satisfying to get a bug squashed quickly.

  5. modified the milestones: 2.4, 3.0 on Oct 28, 2014
  6. self-assigned this
    on Oct 28, 2014
  7. added a commit that references this issue on Nov 3, 2014
    7b8303a
  8. firey-fox commented on Dec 2, 2014

    @firey-fox

    I'm currently running python 2.6. Is there any way I can take advantage of this fix?

  9. Carreau commented on Dec 2, 2014

    @Carreau
    Member

    Support for Python2.6 has beed dropped a long time ago. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions