Просмотр исходного кода

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 лет назад
Родитель
Сommit
c7c0974d17
1 измененных файлов с 1 добавлено и 1 удалено
  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