STINNER Victor <vstin...@redhat.com> added the comment:
I closed the issue. I consider that the initial issue has been fixed and all related issues have been fixed as well: * Python 3.8 now logs close() exception in file finalizer in development mode (-X dev) and debug mode (./configure --with-pydebug) * I added sys.unraisablehook to Python 3.8 which allows to decide how these unraisable exceptions are handled * Tests no longer log any "unraisable exception" in file finalizers (test_io and test_urllib have been fixed) * regrtest now marks a test as ENV_CHANGED if it logs an unraisable exception (like the close() exception) -- For Python 3.7, there is no known workaround. It seems like Python 2.7 in debug mode logs an error: $ python2.7-dbg bug.py close failed in file object destructor: IOError: [Errno 9] Bad file descriptor ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue18748> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com