This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, dstufft, martin.panter, tim.peters, vstinner
Date 2016-06-09.10:06:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> 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:38vstinnersetrecipients: + vstinner, tim.peters, christian.heimes, martin.panter, dstufft
2016-06-09 10:06:38vstinnerlinkissue27272 messages
2016-06-09 10:06:38vstinnercreate