From 17f7008d64f1753c5db96f2fc68bfe5ab41424fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 24 Dec 2024 18:35:12 -0300 Subject: [PATCH] Use `sage_` prefix for the main temporary directory. --- src/sage/misc/temporary_file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sage/misc/temporary_file.py b/src/sage/misc/temporary_file.py index de872802805..820d5cf2e95 100644 --- a/src/sage/misc/temporary_file.py +++ b/src/sage/misc/temporary_file.py @@ -32,7 +32,9 @@ # as the parent for all temporary files & directories created by them. # This lets us clean up after those two functions when sage exits normally # using an atexit hook -TMP_DIR_FILENAME_BASE = tempfile.TemporaryDirectory() +# Note that `TemporaryDirectory()` will cleanup on program exit; +# we keep the atexit hook to be redundant, in case that fails. +TMP_DIR_FILENAME_BASE = tempfile.TemporaryDirectory(prefix='sage_') atexit.register(lambda: TMP_DIR_FILENAME_BASE.cleanup())