ipython: IPython crashes on tab completion: async handler deleted by the wrong thread

IPython 6.2.1 in --pylab mode crashes intermittently but frequently when trying to tab complete after displaying some figures. I apologize I don’t have a test case, as it’s not repeatable.

Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7fbc20e70160>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3504, in __del__
In [81]: sns.pairTcl_AsyncDelete: async handler deleted by the wrong thread
Aborted (core dumped)
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7fc68815f828>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3504, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7fc670d513c8>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3504, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
In [7]: fig.add_Tcl_AsyncDelete: async handler deleted by the wrong thread
Aborted (core dumped)
$ uname -a
Linux xxx 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ python -V
Python 3.6.3
$ ipython -V
6.2.1

Maybe related to #10819?

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 10
  • Comments: 18 (4 by maintainers)

Most upvoted comments

Actually, I’m still having some problems when doing a matplotlib plot and sklearn random forests. I have a plot that gets generated, then a bunch of random forests are fit, and it sometimes randomly quits out with the same ‘async handler’ error.