Jeffrey Kintscher <websur...@surf2c.net> added the comment:
I implemented an onerror callback for tempfile.TemporaryDirectory() and confirmed that it cannot be used to unmount a mount point. Attempting to unmount the mount point from within the callback results in a resource busy error. It may be related to shutil.rmtree() holding an open file descriptor to the parent directory of the mount point. I uploaded the program I used for testing on macOS (test-mounted-image.py). The subprocess.run() calls can be modified to run it on other platforms. ---------- Added file: https://bugs.python.org/file48429/test-mounted-image.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36422> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com