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

qtconsoleapp 'parse_command_line' doen't like --existing anymore #906

Closed
Carreau opened this issue Oct 20, 2011 · 1 comment
Closed

qtconsoleapp 'parse_command_line' doen't like --existing anymore #906

Carreau opened this issue Oct 20, 2011 · 1 comment
Milestone

Comments

@Carreau
Copy link
Member

Carreau commented Oct 20, 2011

on master (87e2f91) Debian squeeze, with some wheezy and sid packages, X forwarding

launching a qtconsole,
python ipython.py qtconsole
and in another
python ipython.py qtconsole --existing kernel-9886.json

rise the following:

Traceback (most recent call last):
  File "ipython.py", line 21, in <module>
    this_dir, 'IPython', 'scripts', 'ipython'
  File "IPython/scripts/ipython", line 7, in <module>
    launch_new_instance()
  File "IPython/frontend/terminal/ipapp.py", line 390, in launch_new_instance
    app.initialize()
  File "IPython/frontend/terminal/ipapp.py", line 291, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "IPython/core/application.py", line 310, in initialize
    self.parse_command_line(argv)
  File "IPython/frontend/terminal/ipapp.py", line 287, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "IPython/config/application.py", line 388, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "IPython/config/application.py", line 332, in initialize_subcommand
    self.subapp.initialize(argv)
  File "IPython/frontend/qt/console/qtconsoleapp.py", line 558, in initialize
    super(IPythonQtConsoleApp, self).initialize(argv)
  File "IPython/core/application.py", line 310, in initialize
    self.parse_command_line(argv)
  File "IPython/frontend/qt/console/qtconsoleapp.py", line 351, in parse_command_line
    self.kernel_argv.remove(a)
ValueError: list.remove(x): x not in list

my guess is that at line 331 and 339 the two for a in argv: both match on a flag in argv (which is a copy of self.kernel_argv, line 331) and try to remove a from it twice... hence the crash.

I can fix it, but I'm not sure it will be the only place where this might append...

@minrk
Copy link
Member

minrk commented Oct 20, 2011

And I fixed this yesterday in the qtconsole_menu PR (cfc7e4a), but I suppose I should put that commit in master straight away, as it's a pretty big deal

@minrk minrk closed this as completed in bae849b Oct 20, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Problem case: flags and aliases with the same name (e.g. existing)

would attempt removal twice, raising ValueError

closes ipythongh-906
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