Terry J. Reedy <[email protected]> added the comment:
The new tk/tkinter bug in the macOS11 U2 build, other than those reported in
#42507 and #42541, is that pressing F5 causes the corresponding pseudoevent
handler, run_module_event, to be called twice. (Its code is above.) The
interval between calls is about 1 millesecond -- .7 to 1.1 in 5 tries. See
this by adding the following at the top of the function's and subtracting after
running code with or without syntax error.
print('run', time.perf_counter())
Adding multiple prints in _run_module_event shows the following for code that
compiles. With the 200 millesecond cocoa delay, the two calls run interleaved
closely interleaved. I don't understand the details, but the result is the
scrambled and incorrect output given above. With no delay as with PR 23577,
the first call calls restart_subprocess in _run_module_event. Then call 2 gets
to the top of this function, then call 1 appears to finish, and call 2 is
somehow aborted.
With a syntax error, the 2nd call, redisplaying the error, is not aborted.
F5 resulting in two calls is not unique, even though I have not yet seen overt
double call effects. In Shell, Control-F6 restarts. A print in its event
handler shows that it is called twice even though there is only 1 restart.
A possible kludge workaround would be to call perf_counter when the class is
created and for Cocoa, each run_module call. Return when new-old <
2milliseconds. But the double call should be fixed as it could show up
elsewhere.
----------
nosy: +serhiy.storchaka, wordtech
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42508>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com