Message268013
> On 'import random' seed random.Random() from _Py_HashSecret.random_seed + gettimeofday().tv_sec + gettimeofday().tv_usec + id(self). That way subinterpreters get a different init state.
Can we use os.urandom() was random.Random is instanciated manually,
but use the "secret random seed" when the random module is imported?
You can easily restrict the feature to workaround blocking "import
random" on VM: consume the secret in the C code, and ensure that it's
only used once.
For example, reimplement random.Random.seed() in C (remove the Python
implementation) and use the secret in C, but only the first user of
seed(None) will get it. WDYT? |
|
Date |
User |
Action |
Args |
2016-06-09 10:06:38 | vstinner | set | recipients:
+ vstinner, tim.peters, christian.heimes, martin.panter, dstufft |
2016-06-09 10:06:38 | vstinner | link | issue27272 messages |
2016-06-09 10:06:38 | vstinner | create | |
|