Ultimately I'd like to add support for a -m to be able to pip install --user. I assume there's a way to do that with the code module?
Closing the peer is what I was describing as solution 3 in D9019. But I think I was wrong in saying that it doesn't help with calls to logtoprocess in the middle of commands. I also just noticed that does that, in fact. I'll try and find some time to do that.
What's holding this back is lack of py2 compatibility. Although maybe I want to wait it out at this point. Do we expect to drop py3 in a few days, after 5.7 is released for instance?
I'm -0 on this change. Caches are caches and IMO should only be populated on demand.