[tor-commits] [ooni-probe/master] Close file descriptor as soon as we have created the temporary file.

art at torproject.org art at torproject.org
Mon Sep 22 20:30:50 UTC 2014


commit 9716b2196d7ef94d56ce7d79e894d32b473def41
Author: Arturo Filastò <art at fuffa.org>
Date:   Thu Sep 18 12:54:00 2014 +0200

    Close file descriptor as soon as we have created the temporary file.
---
 ooni/nettests/blocking/bridge_reachability.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ooni/nettests/blocking/bridge_reachability.py b/ooni/nettests/blocking/bridge_reachability.py
index d4f6e13..f472f75 100644
--- a/ooni/nettests/blocking/bridge_reachability.py
+++ b/ooni/nettests/blocking/bridge_reachability.py
@@ -51,7 +51,8 @@ class BridgeReachability(nettest.NetTestCase):
         self.tor_progress = 0
         self.timeout = int(self.localOptions['timeout'])
 
-        _, self.logfile = tempfile.mkstemp()
+        fd, self.logfile = tempfile.mkstemp()
+        os.close(fd)
 
         self.report['error'] = None
         self.report['success'] = None





More information about the tor-commits mailing list