python module paramiko throw a strange exception as shown on the tile. And finally I find the position it really occurs which is in the module logging. when I set a breakpoint on the line in Eclipse with pydev, and put lines below in the expressions view, the evaluated value confused me. I wonder that in what circumstance the exception may happen, though it's impossible from my view.
self.__class__ # <class 'logging.FileHandler'>
isinstance(self, FileHandler) # False
isinstance(self, StreamHandler) # False
emit method of FileHandler:
def emit(self, record):
"""
Emit a record.
If the stream was not opened because 'delay' was specified in the
constructor, open it before calling the superclass's emit.
"""
if self.stream is None:
self.stream = self._open()
StreamHandler.emit(self, record)
Finally fixed it.
Reloading the module logging caused this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With