STINNER Victor <> 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 
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor


Python tracker <>
Python-bugs-list mailing list

Reply via email to