diff roundup/backends/blobfiles.py @ 6486:8c371af7e785

Close file in blobfile.py storefile() method. ResourceWarning raised by new tests.
author John Rouillard <rouilj@ieee.org>
date Mon, 06 Sep 2021 14:25:24 -0400
parents 8497bf3f23a1
children 16d6d1f9038a
line wrap: on
line diff
--- a/roundup/backends/blobfiles.py	Mon Sep 06 13:44:42 2021 -0400
+++ b/roundup/backends/blobfiles.py	Mon Sep 06 14:25:24 2021 -0400
@@ -332,7 +332,9 @@
         # in multi-tracker (i.e. multi-umask) or modpython scenarios
         # the umask may have changed since last we set it.
         os.umask(self.umask)
-        open(name, 'wb').write(content)
+        fd = open(name, 'wb')
+        fd.write(content)
+        fd.close()
 
     def getfile(self, classname, nodeid, property):
         """Get the content of the file in the database.

Roundup Issue Tracker: http://roundup-tracker.org/