Skip to content

Commit 9863de0

Browse files
authored
bpo-24459: Document missing env variables in python.man (GH-4142)
Initial patch by Joshua Jay Herman.
1 parent f60bf0e commit 9863de0

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

Misc/python.man

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,73 @@ values.
437437

438438
The integer must be a decimal number in the range [0,4294967295]. Specifying
439439
the value 0 will disable hash randomization.
440+
.IP PYTHONMALLOC
441+
Set the Python memory allocators and/or install debug hooks. The available
442+
memory allocators are
443+
.IR malloc
444+
and
445+
.IR pymalloc .
446+
The available debug hooks are
447+
.IR debug ,
448+
.IR malloc_debug ,
449+
and
450+
.IR pymalloc_debug .
451+
.IP
452+
When Python is compiled in debug mode, the default is
453+
.IR pymalloc_debug
454+
and the debug hooks are automatically used. Otherwise, the default is
455+
.IR pymalloc .
456+
.IP PYTHONMALLOCSTATS
457+
If set to a non-empty string, Python will print statistics of the pymalloc
458+
memory allocator every time a new pymalloc object arena is created, and on
459+
shutdown.
460+
.IP
461+
This variable is ignored if the
462+
.RB $ PYTHONMALLOC
463+
environment variable is used to force the
464+
.BR malloc (3)
465+
allocator of the C library, or if Python is configured without pymalloc support.
466+
.IP PYTHONASYNCIODEBUG
467+
If this environment variable is set to a non-empty string, enable the debug
468+
mode of the asyncio module.
469+
.IP PYTHONTRACEMALLOC
470+
If this environment variable is set to a non-empty string, start tracing
471+
Python memory allocations using the tracemalloc module.
472+
.IP
473+
The value of the variable is the maximum number of frames stored in a
474+
traceback of a trace. For example,
475+
.IB PYTHONTRACEMALLOC=1
476+
stores only the most recent frame.
477+
.IP PYTHONFAULTHANDLER
478+
If this environment variable is set to a non-empty string,
479+
.IR faulthandler.enable()
480+
is called at startup: install a handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS
481+
and SIGILL signals to dump the Python traceback.
482+
.IP
483+
This is equivalent to the \fB-X faulthandler\fP option.
484+
.IP PYTHONEXECUTABLE
485+
If this environment variable is set,
486+
.IB sys.argv[0]
487+
will be set to its value instead of the value got through the C runtime. Only
488+
works on Mac OS X.
489+
.IP PYTHONUSERBASE
490+
Defines the user base directory, which is used to compute the path of the user
491+
.IR site-packages
492+
directory and Distutils installation paths for
493+
.IR "python setup\.py install \-\-user" .
494+
.IP PYTHONPROFILEIMPORTTIME
495+
If this environment variable is set to a non-empty string, Python will
496+
show how long each import takes. This is exactly equivalent to setting
497+
\fB\-X importtime\fP on the command line.
498+
.SS Debug-mode variables
499+
Setting these variables only has an effect in a debug build of Python, that is,
500+
if Python was configured with the
501+
\fB\--with-pydebug\fP build option.
502+
.IP PYTHONTHREADDEBUG
503+
If this environment variable is set, Python will print threading debug info.
504+
.IP PYTHONDUMPREFS
505+
If this environment variable is set, Python will dump objects and reference
506+
counts still alive after shutting down the interpreter.
440507
.SH AUTHOR
441508
The Python Software Foundation: https://www.python.org/psf/
442509
.SH INTERNET RESOURCES

0 commit comments

Comments
 (0)