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

qtconsole --pure: "TypeError: string indices must be integers, not str" #519

Closed
mspacek opened this issue Jun 13, 2011 · 1 comment
Closed
Milestone

Comments

@mspacek
Copy link
Contributor

mspacek commented Jun 13, 2011

Not that I ever want to run in pure Python mode, but I keep testing it and finding problems. Running ipython-qtconsole --pure I get this:

>>> a = 1
>>> a
>>> 

i.e. the value of a isn't printed. I get this in the parent terminal:

{'content': {'user_variables': [], 'code': 'a\n', 'user_expressions': {}, 'silent': False},
 'header': {'username': 'mspacek', 'msg_id': 1, 'session': '6ceda2c2-593f-4741-bd5c-8c8969a2288a'},
 'msg_type': 'execute_request',
 'parent_header': {}}
{'content': {'status': 'ok', 'payload': {}},
 'header': {'username': u'kernel', 'msg_id': 4, 'session': '4dcdb4cc-eef5-4c86-a915-ccfb26458ca9'},
 'msg_type': u'execute_reply',
 'parent_header': {'username': 'mspacek', 'msg_id': 1, 'session': '6ceda2c2-593f-4741-bd5c-8c8969a2288a'}}
Traceback (most recent call last):
  File "/home/mspacek/source/ipython/IPython/frontend/qt/base_frontend_mixin.py", line 102, in _dispatch
    handler(msg)
  File "/home/mspacek/source/ipython/IPython/frontend/qt/console/frontend_widget.py", line 372, in _handle_pyout
    self._append_plain_text(msg['content']['data']['text/plain'] + '\n')
TypeError: string indices must be integers, not str

Since I hadn't noticed it before, I think this may be a new problem from a recent commit. I suppose this might be related to #516.

@minrk
Copy link
Member

minrk commented Jun 14, 2011

No, this is not new. It is related to #516 in that the FrontendWidget assumes that messages come from IPython object inspection, and not the reduced reply given by the pure Python kernel. If you confirm that #521 fixes this and #516 for you, I will go ahead and merge it.

@minrk minrk closed this as completed in b5570f7 Jun 14, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
This protects against missing keys in object introspection, etc.
when using the pure Python kernel.

closes ipythongh-516
closes ipythongh-519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants