New submission from Andrei Pashkin <[email protected]>:
Here is an example:
import tempfile
import os
with tempfile.NamedTemporaryFile() as temp:
os.remove(temp.name)
And here is an error it produces:
Traceback (most recent call last):
File "test.py", line 6, in <module>
os.remove(temp.name)
File "/usr/lib/python3.7/tempfile.py", line 639, in __exit__
self.close()
File "/usr/lib/python3.7/tempfile.py", line 646, in close
self._closer.close()
File "/usr/lib/python3.7/tempfile.py", line 583, in close
unlink(self.name)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpzn8gtiz1'
----------
messages: 349794
nosy: pashkin
priority: normal
severity: normal
status: open
title: tempfile.NamedTemporaryFile() raises exception on close() when file is
absent
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37865>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com