Skip to content

Commit 40565e4

Browse files
author
Release Manager
committed
Trac #34593: Document and manage temporary directories
This is a followup to #33213. Some users prefer (or need) to control where temporary files are created, and we should document this: - as described at https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir, users can set the environment variable `TMPDIR` Possible follow-up: - Also, according to https://manpages.ubuntu.com/manpages/bionic/man8/tmpreaper.8.html, at least on some systems it would be helpful to create a non-writable file `.tmpreaper` in the directory to prevent the system from doing automatic cleanup on it. URL: https://trac.sagemath.org/34593 Reported by: jhpalmieri Ticket author(s): John Palmieri Reviewer(s): Matthias Koeppe
2 parents f53f07a + c729c7b commit 40565e4

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

src/doc/en/installation/launching.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,36 @@ To start a Jupyter Notebook instead of a Sage console, run the command
2929
instead of just ``sage``. To quit the Jupyter Notebook press ``<Ctrl> + <c>``
3030
twice in the console where you launched the command.
3131

32+
Environment variables
33+
---------------------
34+
35+
Sage uses the following environment variables when it runs:
36+
37+
- :envvar:`DOT_SAGE` - this is the directory, to which the user has read and
38+
write access, where Sage stores a number of files.
39+
The default location is :file:`$HOME/.sage/`.
40+
41+
- :envvar:`SAGE_STARTUP_FILE` - a file including commands to be executed every
42+
time Sage starts.
43+
The default value is :file:`$DOT_SAGE/init.sage`.
44+
45+
- :envvar:`BROWSER` - on most platforms, Sage will detect the command to
46+
run a web browser, but if this doesn't seem to work on your machine, set this
47+
variable to the appropriate command.
48+
49+
- :envvar:`TMPDIR` - this variable is used by Python, and hence by
50+
Sage; it gives the directory in which temporary files should be
51+
stored. This includes files used by the notebook. Some browsers have
52+
security settings which restrict the locations of files that they
53+
will access, and users may need to set this variable to handle this
54+
situation.
55+
56+
- See
57+
https://docs.python.org/3/using/cmdline.html#environment-variables
58+
for more variables used by Python (not an exhaustive list). With
59+
Python 3.11 or later, a brief summary can also be obtained by
60+
running `python3 --help-env`.
61+
3262
Using a Jupyter Notebook remotely
3363
---------------------------------
3464

src/doc/en/installation/source.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,20 +1086,6 @@ Some standard environment variables which are used by Sage:
10861086
- :envvar:`OPENBLAS_CONFIGURE` - adds additional configuration flags for
10871087
the OpenBLAS package that gets added to the make command. (see :trac:`23272`)
10881088

1089-
Sage uses the following environment variables when it runs:
1090-
1091-
- :envvar:`DOT_SAGE` - this is the directory, to which the user has read and
1092-
write access, where Sage stores a number of files.
1093-
The default location is :file:`$HOME/.sage/`.
1094-
1095-
- :envvar:`SAGE_STARTUP_FILE` - a file including commands to be executed every
1096-
time Sage starts.
1097-
The default value is :file:`$DOT_SAGE/init.sage`.
1098-
1099-
- :envvar:`BROWSER` - on most platforms, Sage will detect the command to
1100-
run a web browser, but if this doesn't seem to work on your machine, set this
1101-
variable to the appropriate command.
1102-
11031089
Variables dealing with doctesting:
11041090

11051091
- :envvar:`SAGE_TIMEOUT` - used for Sage's doctesting: the number of seconds

0 commit comments

Comments
 (0)