[Patches] Change to reference-dump procedure at shutdown
Guido van Rossum
guido@python.org
Mon, 24 Apr 2000 09:50:57 -0400
> This patch only affects debug builds with Py_TRACE_REFS defined. This is the default for debug builds on Windows.
>
> At shutdown, Python offers to dump the remaining references. This upsets a few programs, such as debug COM servers, or any program that uses 'sys.executable' to launch a child-process. The process never terminates, as it is waiting to find out if you want the references dumped.
>
> Further, simply starting and closing the Python interpreter on Windows results in over 2000 references - its unlikely people want to print them that often :-)
>
> The patch below only offers to dump the references if the environment variable PYTHONDUMPREFS is set. Otherwise, it still prints the number of references, but immediately terminates.
>
> If this patch is acceptable and it is felt this variable should be documented, let me know, and I will try and hunt down all the relevant places - but IMO, anyone who really needs these references dumped is likely to see this code :-)
Mark, shouldn't this be enclosed in an #ifdef MS_WINDOWS bracket?
--Guido van Rossum (home page: http://www.python.org/~guido/)