This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Richard Sheridan
Recipients Richard Sheridan, epaine, gpolo, serhiy.storchaka
Date 2020-07-01.11:52:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CADH6UF1sDjsoN=md72vpLpqrztizmZPKbWBGMKWt1pG8hh_VCw@mail.gmail.com>
In-reply-to <1593598503.4.0.814060158142.issue41176@roundup.psfhosted.org>
Content
Removing `WaitForMainloop` would surely break some existing programs, but
that's why I suggested deprecation instead of just removing it suddenly. We
could issue a RuntimeWarning if `WaitForMainloop` actually waits and tell
the client to take responsibility for the race condition they created.
(They may have no idea! What if their delay unexpectedly increases to 1.2
seconds?) Whether or not waiting gets deprecated, it would make sense to
make the sleep behavior configurable instead of hardcoded. I'll include
something along those lines in my PR.

On Wed, Jul 1, 2020 at 6:15 AM E. Paine <report@bugs.python.org> wrote:

>
> E. Paine <paineelisha@gmail.com> added the comment:
>
> I agree it would be helpful to expose an explicit way of telling if the
> mainloop was running but am not sure about removing `WaitForMainloop` as it
> could very easily break existing programs.
>
> If a program executes a tkinter method in a thread before the mainloop is
> executed, the method will wait because of the call to `WaitForMainloop`. In
> the example script this is done deliberately to demonstrate the behaviour
> but could be done accidentally if the main thread has to do something else
> before the mainloop (and after the thread has been created).
>
> I think the changes (whatever is concluded we should do) would be
> considered an 'enhancement', which would not be backported to 3.9 and
> before (I believe 'behaviour' is generally used for logic errors).
>
> I am very willing to help review a PR, however the people you really need
> to convince are Serhiy and/or Guilherme (I have added them to the nosy).
>
> ----------
> nosy: +epaine, gpolo, serhiy.storchaka
> versions:  -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
> Added file: https://bugs.python.org/file49283/waitmainloop.py
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue41176>
> _______________________________________
>
History
Date User Action Args
2020-07-01 11:52:04Richard Sheridansetrecipients: + Richard Sheridan, gpolo, serhiy.storchaka, epaine
2020-07-01 11:52:04Richard Sheridanlinkissue41176 messages
2020-07-01 11:52:04Richard Sheridancreate