David Lukeš <dafydd.lu...@gmail.com> added the comment:

> You can use TemporaryDirectory.

That was actually the first approach I tried :) I even thought this could be 
used to make `mktemp` safe -- just create the name in a `TemporaryDirectory`.

However, after reading through the mailing list thread, I realized this just 
restricts the potential collision/hijacking to misbehaving/malicious processes 
running under the same user or under the super user. But the core problem with 
too easily guessable filenames (= not random enough, or not at all, as in your 
example) remains. Correct me if I'm wrong though.

Sorry, I should probably have mentioned this in OP. I thought about doing so, 
but then it turned out very long even without it, so I decided it would be 
better to discuss it only if someone else mentions it.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43604>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to