Message308043
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 |
|
| Date |
User |
Action |
Args |
| 2017-12-11 14:25:27 | Yaroslav.Halchenko | set | recipients:
+ Yaroslav.Halchenko |
| 2017-12-11 14:25:27 | Yaroslav.Halchenko | set | messageid: <1513002327.33.0.213398074469.issue32276@psf.upfronthosting.co.za> |
| 2017-12-11 14:25:27 | Yaroslav.Halchenko | link | issue32276 messages |
| 2017-12-11 14:25:27 | Yaroslav.Halchenko | create | |
|