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 2014-10-11.22:18:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413065880.69.0.0818621344041.issue22614@psf.upfronthosting.co.za>
In-reply-to
Content
In Jan 2014 in the opening messages of #20167, msg207599, Serhiy Storchaka reported that
./python -m idlelib.idle Lib/decimal.py
opened the file on both 2.7 and 3.4 (beta) but that closing on 3.4 (but not 2.7) caused 'application closed' errors in Multicall .__del__ methods. These have been fixed and recently refixed.

In msg228954, Serhiy reported a new problem, which I an transferring to this new issue, with 2.7 and 3.4 but not 3.5.

./python -m idlelib.idle Lib/decimal.py
Traceback (most recent call last):
  File "/home/serhiy/py/cpython-3.4/Lib/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/serhiy/py/cpython-3.4/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/idle.py", line 11, in <module>
    idlelib.PyShell.main()
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 1562, in main
    if flist.open(filename) is None:
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/FileList.py", line 36, in open
    edit = self.EditorWindow(self, filename, key)
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 141, in __init__
    self.color_breakpoint_text()
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 159, in color_breakpoint_text
    self.text.tag_config('BREAK', cfg)
AttributeError: 'NoneType' object has no attribute 'tag_config'

Serhiy, you did not specify the particular binaries you used. I will assume recent.

Versions: as far as I know, there are no idlelib code differences between 3.4 and default (3.5).  I rechecked closed issues for patches pushed by someone else only to 3.5.  So any behavior difference between 3.4 and 3.5 must by due to a difference in tkinter, another stdlib module, or python itself.

What system? I do not reproduce on Win 7 with an Oct 9 build.

When?  If the command line worked for 2.7 in Jan and fails now, when did it start failing?  If the command worked for 3.4 after the Feb patches and fails now, same question.

How? You did not state, but in a later message implied that the file opened in the editor and the problem only happened when you closed, as with the January report.  However, the traceback says that the problem occurred during initialization.  According to Find in Files, the only call to color_breakpoint_text is that one __init__ call.  I therefore do not understand your msg228957 comment "The code runs up to self.text.update() in restore_file_breaks() and runs further only after windows closing."

restore_file_breaks is only called in two places. One is when file names are changed (which should not happen when closing an untouched file), the other is just before color_break during initialization.  Here is the last part of PyShellEditorWindow.__init__.

        def filename_changed_hook(old_hook=self.io.filename_change_hook,
                                  self=self):
            self.restore_file_breaks()
            old_hook()
        self.io.set_filename_change_hook(filename_changed_hook)
        if self.io.filename:
            self.restore_file_breaks()
        self.color_breakpoint_text()

You msg228958 comment that changing .update to .update_idletasks also puzzles me. According to the tkinter docstrings, the difference is that the latter does less (assuming that .update also clears non-user callbacks, whatever they are)

update(self)
    Enter event loop until all pending events have been processed by Tcl.

update_idletasks(self)
    Enter event loop until all idle callbacks have been called. This
    will update the display of windows but not process events caused by
    the user.

During initialization, I would not expect there to be any user events.
History
Date User Action Args
2014-10-11 22:18:00terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2014-10-11 22:18:00terry.reedysetmessageid: <1413065880.69.0.0818621344041.issue22614@psf.upfronthosting.co.za>
2014-10-11 22:18:00terry.reedylinkissue22614 messages
2014-10-11 22:18:00terry.reedycreate