diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-11-15 20:40:27 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-11-15 20:40:27 (GMT) |
commit | a76157dca6ba0d063a88cf4c0b6ac132881001b1 (patch) | |
tree | 4fab6563416f842e4aa57b168828d4b0b2c894e5 /Lib | |
parent | b11d6cb711cb9b14d3580581d61bec224042feb5 (diff) | |
download | cpython-a76157dca6ba0d063a88cf4c0b6ac132881001b1.zip cpython-a76157dca6ba0d063a88cf4c0b6ac132881001b1.tar.gz cpython-a76157dca6ba0d063a88cf4c0b6ac132881001b1.tar.bz2 |
Issue #19523: Closed FileHandler leak which occurred when delay was set.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/logging/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 4cef66f..7f94e39 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -976,8 +976,10 @@ class FileHandler(StreamHandler): self.flush() if hasattr(self.stream, "close"): self.stream.close() - StreamHandler.close(self) self.stream = None + # Issue #19523: call unconditionally to + # prevent a handler leak when delay is set + StreamHandler.close(self) finally: self.release() |