New submission from Yaroslav Halchenko <yarikop...@gmail.com>: 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
---------- messages: 308043 nosy: Yaroslav.Halchenko priority: normal severity: normal status: open title: there is no way to make tempfile reproducible (i.e. seed the used RNG) _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32276> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com