71084d
71084d
# HG changeset patch
71084d
# User Vinay Sajip <vinay_sajip@yahoo.co.uk>
71084d
# Date 1402737594 -3600
71084d
# Node ID bb8b0c7fefd0c5ed99b3f336178a4f9554a1d0ef
71084d
# Parent  31adcc4c43916f7448c9dd8048ad5be7e5bb6456
71084d
Issue #21742: Set stream to None after closing.
71084d
71084d
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
71084d
--- a/Lib/logging/handlers.py
71084d
+++ b/Lib/logging/handlers.py
71084d
@@ -423,6 +423,7 @@ class WatchedFileHandler(logging.FileHan
71084d
                 # we have an open file handle, clean it up
71084d
                 self.stream.flush()
71084d
                 self.stream.close()
71084d
+                self.stream = None  # See Issue #21742: _open () might fail.
71084d
                 # open a new file handle and get new stat info from that fd
71084d
                 self.stream = self._open()
71084d
                 self._statstream()
71084d