Serhiy Storchaka <storchaka+cpyt...@gmail.com> 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 <rep...@bugs.python.org> <https://bugs.python.org/issue31959> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com