[issue35379] IDLE's close fails io is set to None on Mac

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#41413 exposed another double save on Mac issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#17822 is not what I was thinking of, nor are #17614 or #22614, so I considered 
this issue done for now.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Before closing this, I want to review #17822 and if the specific fix is 
superceded by this one, remove it.

--
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread miss-islington


miss-islington  added the comment:


New changeset 3d916a7b1ee29896bece4a6a37d8084fa3c1abf6 by Miss Islington (bot) 
in branch '3.7':
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
https://github.com/python/cpython/commit/3d916a7b1ee29896bece4a6a37d8084fa3c1abf6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread miss-islington


miss-islington  added the comment:


New changeset 73ccc3322f7ad0d016478ef20237bccd0a314f0a by Miss Islington (bot) 
in branch '3.8':
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
https://github.com/python/cpython/commit/73ccc3322f7ad0d016478ef20237bccd0a314f0a


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15814
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/16213

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset dfd34a9cd58e8150c324190f746de919e140abe8 by Terry Jan Reedy in 
branch 'master':
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
https://github.com/python/cpython/commit/dfd34a9cd58e8150c324190f746de919e140abe8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15815
pull_request: https://github.com/python/cpython/pull/16214

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

By reading idlelib code, I determined that the error must arise from 
EditorWindow.close being called twice.  I confirmed this with a debug print.

EW.close is called from close_event, PyShell.close, and 
filelist.close_all_callback. For the AttributeError I see, msg352409, both 
calls come from PyShell.close (debug print) and at least the second from 
PseudoInputFile.close.  Since it does not happen in 3.7, in spite of code being 
identical, a 3.8 change in Python shutdown must be involved.

I am rather sure that a double close is also the problem on Raymond's mac, with 
at least the second coming from close_all_callback.  The latter is invoked by 
File => exit and exit() or quit().  It might be that I do not remember seeing 
the same traceback because I almost never exit that way.  On Windows, I often 
right click the IDLE taskbar icon and select 'close all windows'.  Or the 
binding of close_all_callback in macOSX might be involved.

As a practical matter, I am defining the bug to be fixed as printing an 
annoying and essentially useless traceback to a terminal used to start IDLE.  I 
could spend hours trying to prevent the 2nd call I see and even if I succeeded, 
there would still be the 2nd call I don't see, and the problem that prompted 
#17822.  Clean tk shutdown is tricky and there are other unresolved issues with 
IDLE tests.

PR 10564 uses the direct approach suggested by Tal.  It works for me however I 
shut down IDLE.

Setting a Boolean flag after the first call might be cleaner, but I don't know 
for sure that it would prevent what Raymond sees, and I want to get a fix into 
3.7.5, and I am more sure that catching AttributeErrors will work for him as 
well.

--
stage: patch review -> commit review
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +15813
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16212

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-14 Thread Tal Einat


Tal Einat  added the comment:

I've also seen these occasionally, but I haven't yet found a way to reproduce 
consistently.

Regardless, IMO the shutdown close() and _close() should be the places handling 
shutdown-related exceptions if possible.  In all of the tracebacks posted here, 
as well as those in #35263 and #17822, one such method is in the call chain, 
and it could simply catch and handle the raised exception.

I also think these are clear improvements that are safe to include, even 
without understanding the full details of the sequences of events leading to 
the errors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

What happens if you immediately close the Shell window?  Perhaps your bug only 
appears after some amount of activity.  (This is not true of the one I see with 
repository python.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Also, the way I start IDLE is from a terminal session:

   $ python3.8 -m idlelib.idle

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

1. your tracebacks are on macOS.
Yes

2. They occur with installed, not repository Python.
python installer

 3. The missing attribute depends on whether Shell or an editor window is 
closed either only or last. 
I don't know the trigger event

What macOS version?
Mojave 10.14.6

python.org installer? 
https://www.python.org/ftp/python/3.8.0/python-3.8.0b4-macosx10.9.pkg

Thanks for looking at this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35379] IDLE's close fails io is set to None on Mac

2019-09-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Raymond, I presume 1. your tracebacks are on macOS. 2. They occur with 
installed, not repository Python. 3. The missing attribute depends on whether 
Shell or an editor window is closed either only or last.  Please verify.  What 
macOS version?  python.org installer?

I cannot, at least now, reproduce this on my Macbook with macOS Mohave (? the 
latest version) running 3.7.4 ('python3') from Terminal.  What could be 
different your system.  The macOS version?  Were your 3.8 reports based on the 
last beta (.0b4)?

I also cannot reproduce on Win10 running installed 3.7.4 or 3.8.0b4 from 
Command Prompt with the py launcher, I do not have any problems when closing.  
---

When running from repository 3.8 or 3.9 (master), but not 3.7, is see the 
following if a Shell is closed, last or not.

Exception ignored in: 
Traceback (most recent call last):
  File "f:\dev\38\lib\idlelib\run.py", line 488, in close
  File "f:\dev\38\lib\idlelib\pyshell.py", line 1020, in close
  File "f:\dev\38\lib\idlelib\editor.py", line 1062, in close
  File "f:\dev\38\lib\idlelib\outwin.py", line 94, in maybesave
  File "f:\dev\38\lib\idlelib\editor.py", line 995, in get_saved
AttributeError: 'NoneType' object has no attribute 'get_saved'

The get_saved fix proposed in PR 10564 (object.method() => object and 
object.method()) will fix this also.  But I want to try changing the closing 
order first.

Tal and Cheryl, other people testing might be helpful.

--
nosy: +cheryl.sabella, taleinat -ronaldoussoren
stage: patch review -> 
title: IDLE's close fails when io.filename set to None -> IDLE's close fails io 
is set to None on Mac

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com