Fix problem with prematurely erased sandbox folder retrieved_temporary_folder #1168
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.
Fixes #1166
The new feature of the retrieve_temporary_list employed an unstored FolderData
node, added to the retrieved dictionary to be passed to the parse_from_retrieved
method of the Parser. The problem is that the temporary folder can be erased
when the object is garbage collected, since that is called in the del method
of the Node class, if it has an unstored sandbox folder. This didn't use to get
called with the old daemon, but with the new daemon and process system, somewhere
in the pipeline this gets triggered causing the sandbox folder to be deleted at
the time it gets to the parse_with_retrieved call.
The solution is to replace the FolderData simply with an absolute folder path
which can be used by the caller to populate with a temporary folder, that is
created within a context manager and will be guaranteed by the caller to be
kept alive until the parse call is completed, upon which it will be destroyed.