[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

R. David Murray report at bugs.python.org
Mon Dec 18 08:37:06 EST 2017


R. David Murray <rdmurray at bitdance.com> added the comment:

IMO it is better to have an API that can be used when, for example, writing tests, than to monkey patch.  On the other hand, I've never had an occasion when I cared about the names of tempfiles (or directories) in my test code, and it is hard to imagine a circumstance when being able to reproduce the sequence of tempfile names chosen would matter for debugging...especially since which filenames are actually chosen from the randomly generated sequence can depend on other activity on the system.  So I concur with the rejection. 

I wouldn't object to some sort of API that allowed one to control the filename generation without worrying that later changes to the module would break ones code, but that isn't actually the use case here, so no one has actually asked for this feature ;)

----------
nosy: +r.david.murray
resolution: fixed -> rejected

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32276>
_______________________________________


More information about the Python-bugs-list mailing list