On 2016-02-23, Ben Finney <ben+pyt...@benfinney.id.au> wrote:
> Oscar Benjamin <oscar.j.benja...@gmail.com> writes:
>> What does unpredictable mean in this context? Maybe I'm reading too
>> much into that...
>
> I think you may be, yes. The request in this thread requires making
> direct use of the “generate a new valid temporary fielsystem path”
> functionality already implemented in ‘tempfile’.
>
> Implementations of that functionality outside of ‘tempfile’ are a fun
> exercise, but miss the point of this thread.

I think you have missed the point of your own thread.

You can't do what you wanted using tempfile, the only possible
answer is to choose a filename that is sufficiently random that
your hope that it is unique won't be proven futile. tempfile has
two main modes, mktemp which meets your requirements but should
never be used as it is insecure, and mkstemp which doesn't meet
your requirements because it fundamentally operates by actually
creating the file in question and relying on the filesystem to
guarantee uniqueness.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to