New submission from Terry J. Reedy:

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.

----------
messages: 229105
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: problem in PyShellEditorWindow.color_breakpoint_text
type: behavior
versions: Python 2.7, Python 3.4

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

Reply via email to