]> granicus.if.org Git - python/commitdiff
Issue #21742: Set stream to None after closing.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 14 Jun 2014 09:19:54 +0000 (10:19 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 14 Jun 2014 09:19:54 +0000 (10:19 +0100)
Lib/logging/handlers.py

index 30ad0365f28d1c0d7ce0ea3ec4ea5e2bd4c51e26..b7bf931aa42548d60605869c2b2a2be5d3832195 100644 (file)
@@ -423,6 +423,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()