Temporary files not properly cleaned up on Windows
Bug #1086860 reported by
Milan Boers
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
OpenTeacher | Status tracked in 3.x | |||||
3.x |
Fix Released
|
Medium
|
Marten de Vries |
Bug Description
Exiting OpenTeacher on Windows when having used certain parts of OpenTeacher raises a WindowsError because files that are in use are being tried to be removed. Windows does not allow file deletion for files that are in use, so apparently the files are in still in use for some reason. I have seen this for loaders\
This bug can cause the temp folder to be very large due to many undeleted OpenTeacher maps.
Related branches
Changed in openteacher: | |
milestone: | none → 3.1 |
To post a comment you must log in.
This bug happened due to file descriptors returned by tempfile.mkstemp weren't closed. That only gives problems on Windows. The fix was to replace: mkstemp( )[1]
path = tempfile.
with
fd, path = tempfile.mkstemp()
os.close(fd)
everywhere. Fixed.