[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 9716b2196d7ef94d56ce7d79e894d32b473def41
Author: Arturo Filastò <art@xxxxxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits