[issue38781] Clear buffer in MemoryHandler flush

2019-11-13 Thread Daniel Andersson
Daniel Andersson added the comment: The suggested change has been merged. I'm closing this issue. Thank you Vinay Sajip for reviewing. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue38781] Clear buffer in MemoryHandler flush

2019-11-12 Thread Daniel Andersson
Change by Daniel Andersson : -- keywords: +patch pull_requests: +16642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17132 ___ Python tracker

[issue38781] Clear buffer in MemoryHandler flush

2019-11-12 Thread Daniel Andersson
New submission from Daniel Andersson : The `logging.handlers.MemoryHandler` has a method `flush` which clears the buffer by assigning an empty list literal: self.buffer = [] This forces the buffer to be a list instance. My suggestion is to clear the buffer like this instead: