> Are we sure this is safe across supported versions? You mention fixed
> upstream, but that always concerns me about compatibility.
Yes, this is just avoiding problems from a change in 2.7 which caused logging to try flushing things late on in module teardown. Prior to that, trace.pop_log_file did everything needed for cleanup and there was no need to care about references at all.
We're defended against weird behaviour from this pretty well already, using StringIO rather than real files and cleaning up testcases as we go should be enough, this is just a cherry on top.
> Are we sure this is safe across supported versions? You mention fixed
> upstream, but that always concerns me about compatibility.
Yes, this is just avoiding problems from a change in 2.7 which caused logging to try flushing things late on in module teardown. Prior to that, trace.pop_log_file did everything needed for cleanup and there was no need to care about references at all.
The original Python change: bugs.python. org/issue6615> hg.python. org/cpython/ diff/022cd0f3c5 58/Lib/ logging/ __init_ _.py>
<http://
<http://
We're defended against weird behaviour from this pretty well already, using StringIO rather than real files and cleaning up testcases as we go should be enough, this is just a cherry on top.