Serhiy Storchaka <[email protected]> added the comment:
This is by design. The first TemporaryDirectory object is destroyed before the
first print statement. For not be surprised use TemporaryDirectory with the
"with" statement.
with TemporaryDirectory() as td:
name = td.name
print(os.path.exists(name)) # prints True
print(os.path.exists(name)) # prints False
----------
nosy: +serhiy.storchaka
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31959>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com