It seems that os.open(..., os.O_NONBLOCK) nevertheless does block, so self.fd is not replaced. If ConsoleLogger.close() gets called at this point from another thread, then a double close is attempted. The fix for this is trivial, although I'm still baffled by how this is possible in eventlet. I also can't seem to be able to reproduce it in a test. However I have reproduced by hand, and have verified that the fix appears to work. The fix is also trivial enough that I'm confident it won't cause any other issues.
It seems that os.open(..., os.O_NONBLOCK) nevertheless does block, so self.fd is not replaced. If ConsoleLogger. close() gets called at this point from another thread, then a double close is attempted. The fix for this is trivial, although I'm still baffled by how this is possible in eventlet. I also can't seem to be able to reproduce it in a test. However I have reproduced by hand, and have verified that the fix appears to work. The fix is also trivial enough that I'm confident it won't cause any other issues.