classification
Title: Idle 3.4.1-: closing Find in Files while in progress closes Idle
Type: behavior Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: python-dev, terry.reedy
Priority: normal Keywords:

Created on 2014-06-08 19:57 by terry.reedy, last changed 2014-06-10 06:54 by terry.reedy. This issue is now closed.

Messages (3)
msg220052 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-08 19:57
Reproducer: On Windows, Open Idle and editor. In editor grep (alt-f3), for instance, 'print' in /Lib/*.py. While hits are flashing by, close the output window with [x]

2.7.6 or .7: Output window closes, Idle continues as desired.
3.3.5 or 3.4.1: All Idle windows - shell, editor, output
3.4.1+, 3.5.0a, debug builds run from console interpreter:
Output window closes, Idle continues, as desired.
console window displays exception ending with 

  File "F:\Python\dev\5\py35\lib\idlelib\GrepDialog.py", line 90, in grep_it
    (fn, lineno, line))
  File "F:\Python\dev\5\py35\lib\idlelib\OutputWindow.py", line 40, in write
    self.text.insert(mark, s, tags)
AttributeError: 'NoneType' object has no attribute 'insert'

The specific fix is to wrap the text insert with try: except: break. The immediate mystery  is why 2.7 did not shutdown with nowhere to print the traceback.
msg220140 - (view) Author: Roundup Robot (python-dev) Date: 2014-06-10 06:50
New changeset ec91ee7d9d8d by Terry Jan Reedy in branch '2.7':
Issue #21695: Catch AttributeError created when user closes grep output window
http://hg.python.org/cpython/rev/ec91ee7d9d8d

New changeset d9c1f36494b6 by Terry Jan Reedy in branch '3.4':
Issue #21695: Catch AttributeError created when user closes grep output window
http://hg.python.org/cpython/rev/d9c1f36494b6
msg220141 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-10 06:54
I added try: except: and tested on installed 3.4.1, which previously failed. There is no way that I know of to start repository Idle without a console to print a traceback to. I added a missing import, removed an incorrect comment, added others, and changed 'print x' in 2.7 to 'print(x)' to reduce differences between versions for future patches.
History
Date User Action Args
2014-06-10 06:54:56terry.reedysetstatus: open -> closed
resolution: fixed
messages: + msg220141

stage: needs patch -> resolved
2014-06-10 06:50:17python-devsetnosy: + python-dev
messages: + msg220140
2014-06-08 19:57:39terry.reedycreate