Terry J. Reedy added the comment:

Cheryl, thank you for reviewing.  I am answering the question about #30868 on 
that issue.

I did not want to immediately test user parser Save() calls in the .save_all 
test for two reasons.

1. I want to first reconsider the general question what to do about Save in the 
new issue.

2. The only specification for .save_all calls to .Save is the code itself, and 
I am not convinced it is correct.  I want to review before semi-freezing the 
code by testing that it does what it does.

Even if it is correct, it will will be tricky to test all paths.  For instance, 
save_all unconditionally call usermain.Save before looking at changes.  Then, 
if changes has changes for usermain, usermain.Save is called again.  To test 
that there are two saves, Func could easily be changed to increment .called 
instead of setting it to 1.

My guess for the double save is that ConfigDialog *might* write some changes 
directly to userCfg, so the unconditional save makes sure they are written.  
But why bypass?  If the dialog is cancelled, the 'unconditional' save will not 
happen, and any directly written changes might affect the current session, but 
might never be saved to disk.  That would seem like a bug.

I have similar questions about the unconditional save of highlights and keys.  
If all three files are always overwritten, why not push any changes to userCfg 
and then write all three without bothering about keeping check if there are 
additional changes?

I am leaving this until I/we have reviewed configdialog while writing tests.

----------

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

Reply via email to