Message 301363 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
To elaborate a bit on the patch:
- it is pointless to call flush() if the buffered is in a bad state (self->ok == 0) or it has started finalizing already
- you need to own the reference, since flush() can release the GIL and, if the reference is borrowed, the refcount can fall to 0 in another thread and the whole object deallocated under your feet