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 cheryl.sabella, terry.reedy
Date 2017-07-07.21:39:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499463546.02.0.838265101734.issue30779@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-07-07 21:39:06terry.reedysetrecipients: + terry.reedy, cheryl.sabella
2017-07-07 21:39:06terry.reedysetmessageid: <1499463546.02.0.838265101734.issue30779@psf.upfronthosting.co.za>
2017-07-07 21:39:06terry.reedylinkissue30779 messages
2017-07-07 21:39:05terry.reedycreate