Blame SOURCES/00268-set-stream-name-to-None.patch

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