Skip to content

Commit afce33b

Browse files
committed
Close file in blobfile.py storefile() method.
ResourceWarning raised by new tests.
1 parent 936596a commit afce33b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roundup/backends/blobfiles.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ def storefile(self, classname, nodeid, property, content):
332332
# in multi-tracker (i.e. multi-umask) or modpython scenarios
333333
# the umask may have changed since last we set it.
334334
os.umask(self.umask)
335-
open(name, 'wb').write(content)
335+
fd = open(name, 'wb')
336+
fd.write(content)
337+
fd.close()
336338

337339
def getfile(self, classname, nodeid, property):
338340
"""Get the content of the file in the database.

0 commit comments

Comments
 (0)