Should I acquire lock for logging.Handler.flush()?

Vinay Sajip vinay_sajip at
Thu Feb 23 14:08:01 EST 2012

On Feb 23, 5:55 pm, Fayaz Yusuf Khan <fayaz.yusuf.k... at>

> Well, as emit() is always being called from within a lock, I assumed that
> flush() should/would also be handled similarly. Afterall, they are handling the
> same underlying output stream or in case of the BufferingHandler share the same
> buffer. Shouldn't the access be synchronized?

Yes, you might well be right - though no problems have been reported,
it's probably best to be safe.


Vinay Sajip

More information about the Python-list mailing list