Support #22470: Use of Python constructs when possible to help context managers to properly manage resources.
Apply the TODOs from #22470 related to "with statement" compatibility
We detected several problems with statement and some of the functions, mostly when managing tarballs and obsolete libraries.
For sl7 the changes done #22470 were reverted (obsolete libraries)but it seems for sl6 there is more work. The reason is that some of the with statement compatibilities were introduced in 2.7 and we have python 2.6 there in sl6.
Since we’re gonna get rid of tarballs (#20033: Should tarballs installations be supported?), changes done related to tarballs or gzip in #22470 will be reverted. Several TODO was added for the future ( when we finally get rid of SL6 and tarballs).
To do: Review all the TODO comments added in v35/22470 and update all the changes.