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

[tor-commits] [chutney/master] Python3 fix: open /dev/urandom in binary mode.



commit c7c0974d1736581cdb6cde473a468fab3d1ab964
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Feb 28 12:18:14 2019 -0500

    Python3 fix: open /dev/urandom in binary mode.
    
    We should really be using os.urandom(), but I'm going for small
    fixes here.
---
 scripts/chutney_tests/verify.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/chutney_tests/verify.py b/scripts/chutney_tests/verify.py
index 063bf8f..82394d2 100644
--- a/scripts/chutney_tests/verify.py
+++ b/scripts/chutney_tests/verify.py
@@ -54,7 +54,7 @@ def _verify_traffic(network):
         dot_reps = _calculate_reps(DOTDATALEN, randomlen)
         # make sure we get at least one dot per transmission
         dot_reps = min(reps, dot_reps)
-        with open('/dev/urandom', 'r') as randfp:
+        with open('/dev/urandom', 'rb') as randfp:
             tmpdata = randfp.read(randomlen)
     else:
         dot_reps = 0



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