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

sys.exit("Quit") raised correctly but then caught by event loop #11584

Open
teh opened this issue Jan 30, 2019 · 2 comments
Open

sys.exit("Quit") raised correctly but then caught by event loop #11584

teh opened this issue Jan 30, 2019 · 2 comments

Comments

@teh
Copy link

teh commented Jan 30, 2019

To reproduce press CTRL+\ in a fresh ipython console (I'm using 7.1.1).

Expected behaviour: ipython quits
Observed behaviour: The following stack trace (chopped off long paths for readability):

Unhandled exception in event loop:
  File "/lib/python3.7/site-packages/prompt_toolkit/eventloop/posix.py", line 154, in _run_task
    t()
  File "/lib/python3.7/site-packages/prompt_toolkit/eventloop/context.py", line 115, in new_func
    return func(*a, **kw)
  File "/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 556, in read_from_input
    self.key_processor.process_keys()
  File "/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 273, in process_keys
    self._process_coroutine.send(key_press)
  File "/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 180, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 323, in _call_handler
    handler.call(event)
  File "/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 78, in call
    return self.handler(event)
  File "/lib/python3.7/site-packages/IPython/terminal/shortcuts.py", line 175, in force_exit
    sys.exit("Quit")

Exception Quit
Press ENTER to continue...                                                                                                                  

Unhandled exception in event loop:
  File "/lib/python3.7/site-packages/prompt_toolkit/eventloop/posix.py", line 154, in _run_task
    t()
  File "/lib/python3.7/site-packages/prompt_toolkit/eventloop/context.py", line 115, in new_func
    return func(*a, **kw)
  File "/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 556, in read_from_input
    self.key_processor.process_keys()
  File "/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 273, in process_keys
    self._process_coroutine.send(key_press)

Additional info:

{'commit_hash': '59a7834d2',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/nix/store/0yx0q6v6nisx4fq1vj8x2vc51n7aj5pz-python3.7-ipython-7.1.1/lib/python3.7/site-packages/IPython',
 'ipython_version': '7.1.1',
 'os_name': 'posix',
 'platform': 'Linux-4.19.12-x86_64-with-glibc2.2.5',
 'sys_executable': '/nix/store/ydk0mfpvn9smcmn72wc9i20slv1d2b79-python3-3.7.2/bin/python3.7',
 'sys_platform': 'linux',
 'sys_version': '3.7.2 (default, Dec 24 2018, 03:41:55) \n[GCC 7.4.0]'}
@Carreau
Copy link
Member

Carreau commented Feb 1, 2019

Meh... thanks for the report. I've the feeling this isgoing to be hackish to fix.

@NotWearingPants
Copy link
Contributor

Any progress on this?

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

3 participants