summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-08-08 22:18:46 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-08-08 22:18:46 (GMT)
commit696e03553b9e455bd6729cee5a8be43a2924f537 (patch)
tree1921798050d0e6f60e64e0a8408690398d2b82f6 /Doc
parent2e5f1178ac55c032982c69f4f4dd70c19f9fa46e (diff)
downloadcpython-696e03553b9e455bd6729cee5a8be43a2924f537.zip
cpython-696e03553b9e455bd6729cee5a8be43a2924f537.tar.gz
cpython-696e03553b9e455bd6729cee5a8be43a2924f537.tar.bz2
Issue #477863: Print a warning at shutdown if gc.garbage is not empty.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/gc.rst12
-rw-r--r--Doc/whatsnew/3.2.rst5
2 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst
index a5c9e7b..29afc96 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -177,6 +177,15 @@ value but should not rebind it):
If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added to
this list rather than freed.
+ .. versionchanged:: 3.2
+ If this list is non-empty at interpreter shutdown, a warning message
+ gets printed:
+
+ ::
+
+ gc: 2 uncollectable objects at shutdown:
+ Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
+
The following constants are provided for use with :func:`set_debug`:
@@ -197,6 +206,9 @@ The following constants are provided for use with :func:`set_debug`:
reachable but cannot be freed by the collector). These objects will be added to
the ``garbage`` list.
+ .. versionchanged:: 3.2
+ Also print the contents of the :data:`garbage` list at interpreter
+ shutdown (rather than just its length), if it isn't empty.
.. data:: DEBUG_SAVEALL
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index 91fd0c2..f4802a0 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -119,6 +119,11 @@ New, Improved, and Deprecated Modules
* The :class:`ftplib.FTP` class now supports the context manager protocol
(Contributed by Tarek Ziadé and Giampaolo Rodolà; :issue:`4972`.)
+* A warning message will now get printed at interpreter shutdown if
+ the :data:`gc.garbage` list isn't empty. This is meant to make the
+ programmer aware that his code contains object finalization issues.
+ (Added by Antoine Pitrou; :issue:`477863`.)
+
* The :func:`shutil.copytree` function has two new options:
* *ignore_dangling_symlinks*: when ``symlinks=False`` (meaning that the