[issue26362] Approved API for creating a temporary file path

Serhiy Storchaka report at bugs.python.org
Sat Mar 13 10:56:17 EST 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

This function would increase security risks. Even if it will be documented as "This function is only purposed to generate file paths which looks similar to paths of temporary files generated by other functions in this module, but should not be used for any access to filesystem", it would be used to generate file paths and opening files with these paths by users which do not read documentation and do not know the right way (because they do not read documentation).

It has flaws which require to deprecate it from start.

If you want to shoot in your foot, just use private generator function tempfile._get_candidate_names(). But it should not be encouraged.

I am for closing this issue by rejecting the proposition.

----------

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


More information about the Python-bugs-list mailing list