Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug during integration of IPython console in Qt application #5031

Closed
rossant opened this issue Feb 5, 2014 · 5 comments · Fixed by #5039
Closed

Bug during integration of IPython console in Qt application #5031

rossant opened this issue Feb 5, 2014 · 5 comments · Fixed by #5039
Milestone

Comments

@rossant
Copy link
Contributor

rossant commented Feb 5, 2014

I have a PyQt application that integrates an IPython Qt console widget. It was working fine until now (I recently updated IPython to master). I'm not sure what's going on. The code is here.

======================================================================
ERROR: klustaviewa.views.tests.test_ipythonview.test_ipythonview
----------------------------------------------------------------------
Traceback (most recent call last):
  File "P:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\nose\cas
e.py", line 197, in runTest
    self.test(*self.arg)
  File "D:\Git\klustaviewa\klustaviewa\views\tests\test_ipythonview.py", line 36
, in test_ipythonview
    window = show_view(IPythonView, **kwargs)
  File "D:\Git\klustaviewa\klustaviewa\views\tests\utils.py", line 137, in show_
view
    window = show_window(TestWindow)
  File "D:\Git\qtools\qtools\utils.py", line 28, in show_window
    window = window(**kwargs)
  File "D:\Git\klustaviewa\klustaviewa\views\tests\utils.py", line 90, in __init
__
    self.view = view_class(self, getfocus=False)
  File "D:\Git\klustaviewa\klustaviewa\views\ipythonview.py", line 44, in __init
__
    self.control.kernel_client = self.kernel_client
  File "d:\git\ipython\IPython\qt\base_frontend_mixin.py", line 64, in kernel_cl
ient
    self._started_channels()
  File "d:\git\ipython\IPython\qt\console\ipython_widget.py", line 280, in _star
ted_channels
    self.kernel_client.kernel_info()
AttributeError: 'QtInProcessKernelClient' object has no attribute 'kernel_info'
-------------------- >> begin captured logging << --------------------

IPython.kernel.inprocess.ipkernel: DEBUG:
*** MESSAGE TYPE:execute_request***
IPython.kernel.inprocess.ipkernel: DEBUG:    Content: {'code': u'', 'silent': Tr
ue, 'user_variables': [], 'store_history': True, 'user_expressions': {}, 'allow_
stdin': True}
   --->

IPython.kernel.inprocess.ipkernel: DEBUG: {'parent_header': {'date': datetime.da
tetime(2014, 2, 5, 11, 41, 15, 331000), 'username': 'username', 'session': '8c95
6882-0a88-424b-9388-fb77fef5e792', 'msg_id': '86a7a466-45ad-4bdb-93ba-f33e1bd340
b9', 'msg_type': 'execute_request'}, 'msg_type': u'execute_reply', 'msg_id': '7e
9b1242-88b4-4ad3-b7df-eb199b045cea', 'content': {'status': u'ok', 'execution_cou
nt': 0, 'user_variables': {}, 'payload': [], 'user_expressions': {}}, 'header':
{'date': datetime.datetime(2014, 2, 5, 11, 41, 15, 338000), 'username': u'userna
me', 'session': u'49828235-6b29-4ba1-81fe-3e4184b15830', 'msg_id': '7e9b1242-88b
4-4ad3-b7df-eb199b045cea', 'msg_type': u'execute_reply'}, 'tracker': <zmq.sugar.
tracker.MessageTracker object at 0x0000000012B45C50>, 'metadata': {'dependencies
_met': True, 'engine': u'39a05a32-a60f-49a5-b02d-74c0b3cd7212', 'status': u'ok',
 'started': datetime.datetime(2014, 2, 5, 11, 41, 15, 337000)}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 0.323s

FAILED (errors=1)
@takluyver
Copy link
Member

Can you give #5039 a try?

@pradal
Copy link
Contributor

pradal commented Feb 6, 2014

I have the same problem and the #5039 is not sufficient.
The method kernel_info in the class InProcessShellChannel is not implemented.
It works well if I add the method:

def kernel_info(self):
    """Request kernel info."""
    msg = self.client.session.msg('kernel_info_request')
    self._dispatch_to_kernel(msg)
    return msg['header']['msg_id']

@takluyver
Copy link
Member

Sorry, I didn't test that out properly before opening the PR. I'll add @pradal's method.

@takluyver
Copy link
Member

OK, I've added that, and Travis is happy with me again. Can you give it another try?

@minrk minrk added this to the 2.0 milestone Feb 7, 2014
@rossant
Copy link
Contributor Author

rossant commented Feb 7, 2014

Thanks, it works!

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants