[Python-checkins] cpython (3.4): Issue #21742: Set stream to None after closing.

vinay.sajip python-checkins at python.org
Sat Jun 14 11:23:36 CEST 2014


http://hg.python.org/cpython/rev/6f1f38775991
changeset:   91173:6f1f38775991
branch:      3.4
parent:      91170:277d099a134b
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Sat Jun 14 10:22:05 2014 +0100
summary:
  Issue #21742: Set stream to None after closing.

files:
  Lib/logging/handlers.py |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -463,6 +463,7 @@
                 # 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()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list