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 Yaroslav.Halchenko
Recipients Yaroslav.Halchenko
Date 2017-12-11.14:25:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513002327.33.0.213398074469.issue32276@psf.upfronthosting.co.za>
In-reply-to
Content
It is quite often desired to reproduce the same failure identically. In many cases sufficient to seed the shared random._inst (via random.seed). tempfile creates new instance(s) for its own operation and does not provide API to seed it.  I do not think it would be easy (unless I miss some pattern) to make it deterministic/reproducible for multi-process apps, but I wondered why initially (for the main process) tempfile module doesn't just reuse the random._inst while only creating a new _Random in children processes?
Another alternative solution would be to allow to specify seed for all those mkstemp/mkdtemp/... and pass it all way to _RandomNameSequence which would initialize _Random with it.  This way, developers who need to seed it, could do so
History
Date User Action Args
2017-12-11 14:25:27Yaroslav.Halchenkosetrecipients: + Yaroslav.Halchenko
2017-12-11 14:25:27Yaroslav.Halchenkosetmessageid: <1513002327.33.0.213398074469.issue32276@psf.upfronthosting.co.za>
2017-12-11 14:25:27Yaroslav.Halchenkolinkissue32276 messages
2017-12-11 14:25:27Yaroslav.Halchenkocreate