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 terry.reedy
Recipients serhiy.storchaka, terry.reedy
Date 2016-05-15.05:25:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463289946.09.0.360878393598.issue27024@psf.upfronthosting.co.za>
In-reply-to
Content
Win10, 3.5.1: Run 'python' in interactive mode.
>>> import idlelib.idle  # open idle shell
# or import idlelib.__main__
# only works once in an interactive session as re-import does not rerun
# In IDLE, open editor to some file.  For instance, alt-M, idlelib.run.

# Close editor, close shell.  In python, see something like
>>> bgerror failed to handle background error.
    Original error: invalid command name "2361007434952font_timer_event"
    Error in bgerror: can't invoke "tk" command: application has been destroyed"

Exit python, restart, import to start idle.
Close shell, close editor.  In python window, see
>>> invalid command name "1220802489864timer_event"
    while executing
"1220802489864timer_event"
    ("after" script)
invalid command name "1220865810504font_timer_event"
    while executing
"1220865810504font_timer_event"
    ("after" script)

Opening IDLE directly with 'python -m idlelib' (or 'idlelib.idle') does not show the problem.  So this is not a problem for the vast majority of users who run idle in an idle process.

My guess is that shutting down the entire process instead of just the idle part of a process shuts down tcl/tk and any pending callbacks.  Perhaps some tkinter class is called without passing the explicit IDLE root.  Though I then would not understand why the callback fails.

My guess is that the order dependence is associated with the startup and shutdown code being part of PyShell instead of being in an independent app module.  (I hope to change this.)

Serhiy, do you have any additiional insight into what is going on and what I should look for?
History
Date User Action Args
2016-05-15 05:25:46terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2016-05-15 05:25:46terry.reedysetmessageid: <1463289946.09.0.360878393598.issue27024@psf.upfronthosting.co.za>
2016-05-15 05:25:46terry.reedylinkissue27024 messages
2016-05-15 05:25:44terry.reedycreate