-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document and manage temporary directories #34593
Comments
comment:1
Of course I don't know where we should document this, since it's a Python feature which may be used in various components of Sage. I don't know the natural home for it. |
comment:2
Regarding the ticket title, IMHO the objective should be more "manage" than "document" since 3D plots are badly broken in Sage 9.7 for (at least) Ubuntu 22.04 users with the default settings, as revealed by https://ask.sagemath.org/question/64192/temporary-html-files-location-in-sage-97/ |
comment:4
Should Sage itself set the environment variable |
comment:5
Replying to John Palmieri:
This could a solution, for instance defining |
This comment has been minimized.
This comment has been minimized.
comment:7
Replying to Eric Gourgoulhon:
I beleive that the cleanup is automatic, using Python's (there is of course always a chance of a segfault-like abnormal exit, which might leave
This is what we have in import tempfile
import atexit
# Until tmp_dir() and tmp_filename() are removed, we use this directory
# 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()
atexit.register(lambda: TMP_DIR_FILENAME_BASE.cleanup()) |
comment:8
In an environment such as SageMathCell, I think one user runs many Sage instances, so one cannot clean anything on startup without risking to affect other instances. |
comment:9
Let's move the documentation of runtime environment variables, starting at "Sage uses the following environment variables when it runs:" https://doc.sagemath.org/html/en/installation/source.html to the "Launching section" and add TMPDIR there (perhaps pointer to Python runtime environment variables) |
comment:10
It's not just Sage, it's a general Jupyter problem. See ContinuumIO/anaconda-issues#12891 and https://askubuntu.com/questions/1389798/how-to-correctly-configure-snapd-firefox-to-open-local-html-file-generated-by. |
comment:11
And also jupyter/notebook#4500. |
Branch: u/jhpalmieri/document-TMPDIR |
Author: John Palmieri |
comment:13
Here is an addition to the documentation. New commits:
|
Commit: |
Reviewer: Matthias Koeppe |
This comment has been minimized.
This comment has been minimized.
comment:15
Thank you! |
Changed branch from u/jhpalmieri/document-TMPDIR to |
This is a followup to #33213. Some users prefer (or need) to control where temporary files are created, and we should document this:
TMPDIR
Possible follow-up:
.tmpreaper
in the directory to prevent the system from doing automatic cleanup on it.Component: misc
Author: John Palmieri
Branch/Commit:
c729c7b
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/34593
The text was updated successfully, but these errors were encountered: