[issue31959] Directory at `TemporaryDirectory().name` does not exist

2017-11-06 Thread Adam Dangoor
Adam Dangoor <adamdang...@gmail.com> added the comment: Thank you for clearing this up for me. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31959] Directory at `TemporaryDirectory().name` does not exist

2017-11-06 Thread Adam Dangoor
Adam Dangoor <adamdang...@gmail.com> added the comment: > The unexpected behavior occurs on CPython 3.5.3 and CPython 3.6.X but not on > pypy. This suggests that it is something to do with garbage collection. Upon further thought, maybe this is by design, but I still w

[issue31959] Directory at `TemporaryDirectory().name` does not exist

2017-11-06 Thread Adam Dangoor
New submission from Adam Dangoor <adamdang...@gmail.com>: Sample code: ``` import os from tempfile import TemporaryDirectory name = TemporaryDirectory().name print(os.path.exists(name)) # prints False td = TemporaryDirectory() name_2 = td.name print(os.path.exists(name_2)) # print