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 ignores exec_lines #545

Closed
eteq opened this issue Jun 30, 2011 · 5 comments
Closed

qtconsole ignores exec_lines #545

eteq opened this issue Jun 30, 2011 · 5 comments
Milestone

Comments

@eteq
Copy link
Contributor

eteq commented Jun 30, 2011

When I start a new qtconsole using a profile I've defined (or, for that matter, the default profile), the IPKernelApp.exec_lines configuration option seems to be ignored. Based on the behavior of the ipython_config.py TerminalIPythonApp.exec_lines option, I would have expected lines in the IPKernelApp.exec_lines list to be run when I start the qtconsole.

For example, if I add the following line to my ipython_qtconsole_config.py file:

 c.IPKernelApp.exec_lines = ['from __future__ import division']

and then run the qtconsole, inputting "1/2" still gives me "0" instead of the expected "0.5". On the other hand, if I execute "from future import division" by hand and then "1/2", "0.5" comes out.

@minrk
Copy link
Member

minrk commented Jun 30, 2011

This code definitely works for me.

@minrk
Copy link
Member

minrk commented Jun 30, 2011

Do you set any other exec_lines values in ipython_config? You can see the current config by printing get_ipython().config in the console.

@eteq
Copy link
Contributor Author

eteq commented Jun 30, 2011

Starting using "ipython qtconsole", get_ipython().config shows me the following:

{'KernelApp': {'hb_port': 57786,
  'iopub_port': 57784,
  'ip': '127.0.0.1',
  'parent': 1,
  'shell_port': 57783,
  'stdin_port': 57785},
 'ProfileDir': {},
 'TerminalIPythonApp': {'exec_lines': ['from __future__ import division']},

'TerminalInteractiveShell': {'colors': 'Linux'}}

The 'TerminalIPythonApp' entry appears to be because I have "c.TerminalIPythonApp.exec_lines = ['from future import division']" in my ipython_config.py file for this profile. I can comment out this line, and it will disappear. Either way, though, I still get the 1/3=0 behavior...

@eteq
Copy link
Contributor Author

eteq commented Jun 30, 2011

On a hunch, I pulled the latest master (apparently I was a few days behind), and rebuilt ipython. After trying again, this issue now seems to be resolved, so I guess it was very recently fixed.

Sorry for the noise!

@eteq eteq closed this as completed Jun 30, 2011
@minrk
Copy link
Member

minrk commented Jun 30, 2011

Ah, you said it was in ipython_qtconsole_config.py. Yes, that was actually #544, and just closed today. It wasn't the specific configurable that was being ignored in the kernel, but the entire file, which was only loaded by the frontend.

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

No branches or pull requests

2 participants