BF: Opening the same experiment in two Builder windows caused the prefs file to be saved wrong, leading to an error next time the app started#7045
Merged
TEParsons merged 1 commit intopsychopy:devfrom Jan 10, 2025
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #7045 +/- ##
=======================================
Coverage 50.59% 50.59%
=======================================
Files 347 347
Lines 62873 62874 +1
=======================================
+ Hits 31809 31814 +5
+ Misses 31064 31060 -4
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a quirk of the
contribmodule which we save/load the prefs file using - it only seems to allow 1 level of nesting dicts, so doingself.appData['frames'][str(self.filename)]saved in the file as if it wereself.appData[str(self.filename)]. If you had the same experiment open twice, the first one would be saved in the prefs file, then the file would be reloaded, then when the second one saved it wouldn't recognise that the same file is already present because it's looking 1 level down from where the prefs file maxed out.In the long term I think we should do away with
contribin favour of Python builtinconfigparser, but adding this check fixes the immediate problem