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

2017-11-06 Thread Adam Dangoor
New submission from Adam Dangoor : 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)) # prints True ``` Expected behavior

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

2017-11-06 Thread Adam Dangoor
Adam Dangoor 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 was sur

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

2017-11-06 Thread Adam Dangoor
Adam Dangoor added the comment: Thank you for clearing this up for me. -- ___ Python tracker <https://bugs.python.org/issue31959> ___ ___ Python-bugs-list mailin