_randbelow might not be available
In !1 (merged) random._randbelow()
was used to improve the performance of the fuzzer. However, on certain platforms this function might not be available.
On a freshly installed Ubuntu 20.04 LTS with Python 3.8.5:
Traceback (most recent call last):
File "fuzz.py", line 16, in <module>
fuzz()
File "/path/to/pythonfuzz/pythonfuzz/main.py", line 29, in __call__
f.start()
File "/path/to/pythonfuzz/pythonfuzz/fuzzer.py", line 115, in start
buf = self._corpus.generate_input()
File "/path/to/pythonfuzz/pythonfuzz/corpus.py", line 99, in generate_input
return self.mutate(buf)
File "/path/to/pythonfuzz/pythonfuzz/corpus.py", line 106, in mutate
x = self._rand(15)
File "/path/to/pythonfuzz/pythonfuzz/corpus.py", line 49, in _rand
return random._randbelow(n)
AttributeError: module 'random' has no attribute '_randbelow'