[Python-checkins] r69645 - python/branches/io-c/Modules/_iobase.c

antoine.pitrou python-checkins at python.org
Sun Feb 15 19:23:26 CET 2009


Author: antoine.pitrou
Date: Sun Feb 15 19:23:26 2009
New Revision: 69645

Log:
Add a warning about the embarassing state of IOBase finalization



Modified:
   python/branches/io-c/Modules/_iobase.c

Modified: python/branches/io-c/Modules/_iobase.c
==============================================================================
--- python/branches/io-c/Modules/_iobase.c	(original)
+++ python/branches/io-c/Modules/_iobase.c	Sun Feb 15 19:23:26 2009
@@ -201,6 +201,10 @@
     ((PyObject *) self)->ob_refcnt++;
     /* The object could already be in an usable state, so we'll take any
        error as meaning "stop, nothing to see here". */
+    /* XXX any Python method or property called from here may rely on
+       attributes being set in the instance __dict__, but the __dict__ has
+       already been cleared by subtype_dealloc().
+       Worse, since exceptions are silenced, the user will be unaware of it. */
     res = PyObject_GetAttr(self, _PyIO_str_closed);
     if (res == NULL)
         PyErr_Clear();


More information about the Python-checkins mailing list