New submission from Ben Finney:

The security issues of `tempfile.mktemp` are clear when the return value is 
used to create a filesystem entry. The documentation and docstrings (and even 
some comments on past issues) are correct o deprecate its use for that purpose.

The function has a use which doers not have security implications: generating 
test data. When a test case wants to generate unpredictable, unique, valid 
filesystem paths – and *never access those paths* on the filesystem – the 
`tempfile.mktemp` function is right there and is very useful.

The `tempfile._RandomNameSequence` class would also be useful, but its name 
also makes clear that it is not part of the library public API.

Please make that functionality available for the purpose of *only* generating 
filesystem paths as `tempfile._RandomNameSequence` does, in a public, 
supported, non-deprecated API.

----------
components: Library (Lib)
messages: 260291
nosy: bignose
priority: normal
severity: normal
status: open
title: Approved API for creating a temporary file path
type: behavior
versions: Python 3.5, Python 3.6

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

Reply via email to