util: close temporary file descriptor

When we moved away from the core mercurial atomic temp logic, we forgot to close
the file descriptor that was opened by mkstemp.
This commit is contained in:
Durham Goode 2016-05-20 08:41:04 -07:00
parent 9f5acf47bd
commit 02c488a9f6

View File

@ -121,6 +121,8 @@ def writefile(path, content, readonly=False):
raise
fd, temp = tempfile.mkstemp(prefix='.%s-' % filename, dir=dirname)
os.close(fd)
try:
f = util.posixfile(temp, 'wb')
f.write(content)