A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048596.html below:

[Python-Dev] random.py still broken wrt. urandom

[Python-Dev] random.py still broken wrt. urandom [Python-Dev] random.py still broken wrt. urandom"Martin v. Löwis" martin at v.loewis.de
Sat Sep 4 15:12:10 CEST 2004
I consider the random module still broken in its current form (1.66).
It tries to invoke random.urandom(1) in order to find out whether
urandom works. Instead, it should defer that determination until
urandom is actually used; i.e. instead of

             if _urandom is None:
                 import time
                 a = long(time.time() * 256) # use fractional seconds
             else:
                 a = long(_hexlify(_urandom(16)), 16)

it should read

             try:
                 a = long(_hexlify(os.urandom(16)), 16)
             except NotImplementedError:
                 import time
                 a = long(time.time() * 256) # use fractional seconds

IMO the patch to random.py should not have been applied without a
review.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4