[issue18748] io.IOBase destructor silence I/O error on close() by default

STINNER Victor report at bugs.python.org
Fri Apr 12 11:17:26 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

To debug remaining "Exception ignored in:" issues, I'm using the following patch:

diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 972a4658b1..be38af3daa 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -710,6 +710,7 @@ class TestCase(object):
 
             # clear the outcome, no more needed
             self._outcome = None
+            import gc; gc.collect()
 
     def doCleanups(self):
         """Execute all cleanup functions. Normally called for you after

And I run:

./python -X dev -u -m test test_io -v 2>&1|tee log

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18748>
_______________________________________


More information about the Python-bugs-list mailing list