mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Issue #21742: Set stream to None after closing.
This commit is contained in:
parent
e0d324d02b
commit
0220048083
1 changed files with 1 additions and 0 deletions
|
|
@ -463,6 +463,7 @@ class WatchedFileHandler(logging.FileHandler):
|
||||||
# we have an open file handle, clean it up
|
# we have an open file handle, clean it up
|
||||||
self.stream.flush()
|
self.stream.flush()
|
||||||
self.stream.close()
|
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
|
# open a new file handle and get new stat info from that fd
|
||||||
self.stream = self._open()
|
self.stream = self._open()
|
||||||
self._statstream()
|
self._statstream()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue