New submission from Terry J. Reedy:

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?

----------
components: IDLE
messages: 265581
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE shutdown glitch when started by import
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27024>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to