aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/sosreport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 65eb29e6..8f9b3f18 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -84,7 +84,7 @@ class TempFileUtil(object):
def new(self):
fd, fname = tempfile.mkstemp(dir=self.tmp_dir)
# avoid TOCTOU race by using os.fdopen()
- fobj = os.fdopen(fd)
+ fobj = os.fdopen(fd, 'w+')
self.files.append((fname, fobj))
return fobj