Author terry.reedy
Recipients Sarbjit.singh, asvetlov, docs@python, serhiy.storchaka, terry.reedy
Date 2016-02-19.04:14:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If I understand the test code, it creates the tk window in thread 0 (the main thread), generates data in thread 1, sends data via a queue to thread 2, which then inserts it into the Text widget.  I ran a 3.x version up to 34000 iterations.  When I comment out 'tk.mainloop()' or stop the mainloop with ^C, thread 2 stops (reproducibly) with

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Programs\Python35\lib\", line 914, in _bootstrap_inner
  File "C:\Programs\Python35\lib\", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "F:\Python\mypy\", line 23, in QueueHandler
  File "C:\Programs\Python35\lib\tkinter\", line 1330, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Programs\Python35\lib\tkinter\", line 1321, in _configure, cmd)) + self._options(cnf))
RuntimeError: main thread is not in main loop

I removed the spamming of Shell with 'running' and sped up the test code by reducing the queued and inserted text to the iteration number and reran to completion at 999999.  I retract my statement about all widget access in threads being unsupported.  At least some seems to be at least in 3.x.

Running the original test code above in 2.7.11 from IDLE and console both fail before 2000 iterations in my tries.

Sarbjit: I do not understand 'tkinter wizard'.

Serhiy: I am coming back to this after reading #11077.  Do you have any idea why this code runs in 3.x but eventually fails in 2.x?  If there anything to do, or just close?
Date User Action Args
2016-02-19 04:14:16terry.reedysetrecipients: + terry.reedy, asvetlov, docs@python, serhiy.storchaka, Sarbjit.singh
2016-02-19 04:14:16terry.reedysetmessageid: <>
2016-02-19 04:14:16terry.reedylinkissue16823 messages
2016-02-19 04:14:15terry.reedycreate