summaryrefslogtreecommitdiffstats
path: root/Lib/logging/handlers.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-14 09:22:05 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-14 09:22:05 (GMT)
commit0220048083866034973ce7b05735ded97d2ca4d4 (patch)
tree1ae33b8eff8e91afa9af41248ce343780f90354b /Lib/logging/handlers.py
parente0d324d02b5a9a5c22d79d0443ca68bf33398978 (diff)
downloadcpython-0220048083866034973ce7b05735ded97d2ca4d4.zip
cpython-0220048083866034973ce7b05735ded97d2ca4d4.tar.gz
cpython-0220048083866034973ce7b05735ded97d2ca4d4.tar.bz2
Issue #21742: Set stream to None after closing.
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r--Lib/logging/handlers.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index f547d17..0e58dbe 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()