Browse Source

Python3 fix: open /dev/urandom in binary mode.

We should really be using os.urandom(), but I'm going for small
fixes here.
Nick Mathewson 5 years ago
parent
commit
c7c0974d17
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scripts/chutney_tests/verify.py

+ 1 - 1
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