]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #21742: Set stream to None after closing.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 14 Jun 2014 09:22:05 +0000 (10:22 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 14 Jun 2014 09:22:05 +0000 (10:22 +0100)
Lib/logging/handlers.py

index f547d17ca20803d9c1f8c88f53476e2912dfdd99..0e58dbea059eefb59a7b81704b8bfe2f33e73817 100644 (file)
@@ -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()