[issue22107] tempfile module misinterprets access denied error on Windows

Erik Aronesty report at bugs.python.org
Fri Sep 27 09:30:39 EDT 2019


Erik Aronesty <erik at q32.com> added the comment:

i would like to point out that the primary reason any of this nonsense exists is because of short filename restrictions.   

i've replaces nearly all of my temp file creation code in all of my project to `return os.urandom(32).hex()` ... which is reliable secure, fast, and doesn't require any fileops

sure, it doesn't work on 8.3 limited systems, but maybe the NamedTemp code should check that *first*.... and *if* it's OK to use long  names... just use them, otherwise revert to existing behavior

----------

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


More information about the Python-bugs-list mailing list