wyz23x2 <[email protected]> added the comment:
You could add a check that does this:
(a)
from tempfile import mktemp
with open(mktemp()) as f:
# do something...
## No Warnings
(b)
from tempfile import mktemp
path = mktemp()
# do something...
with open(mktemp()) as f:
# do something...
## RuntimeWarning: mktemp() is unsafe. Use NamedTemporaryFile(delete=False).
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39768>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com