From 0220048083866034973ce7b05735ded97d2ca4d4 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Sat, 14 Jun 2014 10:22:05 +0100 Subject: [PATCH] Issue #21742: Set stream to None after closing. --- Lib/logging/handlers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index f547d17ca20..0e58dbea059 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -463,6 +463,7 @@ class WatchedFileHandler(logging.FileHandler): # we have an open file handle, clean it up self.stream.flush() self.stream.close() + self.stream = None # See Issue #21742: _open () might fail. # open a new file handle and get new stat info from that fd self.stream = self._open() self._statstream()