Closed steipatr closed 1 year ago
@steipatr Thanks for opening this PR! If you provide me with instructions how to test / reproduce I can test on Windows.
@quaquel I might have someone also experiencing this error. Could you review this PR and merge it if you approve? Then we could issue a patch release.
Thanks for the very quick response, thanks!
Did we (or the CI) test this on a Unix / Linux system?
At some point using rmtree
was discussed in #72. What was the consideration for going with this solution?
A potential rmtree
looks quite clean:
import shutil
def repeat_report(self, netlogo_reporter, reps, go="go", include_t0=True):
# ... existing code here ...
# cleanup temp files and folders
for fh in fhs:
os.close(fh) # free up file handle for re-use
shutil.rmtree(tempfolder) # remove folder and its contents
return results
I did not test it, nor do I have time atm to test it.
Anne confirmed that this solved the problem for her!
Change order in which temporary files, handles, and folders are cleaned up in repeat_report(). If accepted, this closes #72 .