[issue31959] Directory at `TemporaryDirectory().name` does not exist
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: `True` is printed for both print statements. I have run this example on: * CPython 3.6.3 * CPython 3.5.3 * pypy 3.5.3 The unexpected behavior occurs on CPython 3.5.3 and CPython 3.6.X but not on pypy. (bug found with Tim Weidner https://github.com/timaa2k). -- components: Library (Lib) messages: 305637 nosy: Adam Dangoor priority: normal severity: normal status: open title: Directory at `TemporaryDirectory().name` does not exist type: behavior versions: Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue31959> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31959] Directory at `TemporaryDirectory().name` does not exist
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 surprised. -- ___ Python tracker <https://bugs.python.org/issue31959> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31959] Directory at `TemporaryDirectory().name` does not exist
Adam Dangoor added the comment: Thank you for clearing this up for me. -- ___ Python tracker <https://bugs.python.org/issue31959> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com