this commit passes locally and on travis:  https://github.com/qwcode/pip/commit/e85515e6e95d28c166a055ef1cc33cb18016bc27
Travis:   https://travis-ci.org/qwcode/pip/builds/12154206

so, we could go with this, but 2 thoughts:
1) that test doesn't *have* to use StringIO, so we could change the test, but since we're here, we might as well sort it out
2) I'm not super happy about the conditional to check for a buffer attribute.  seems we might be better off with a cross-compatible `open`, instead of `fwrite`.  also, do away with the business where the logger checks for `write`.  just declare that log consumers have to support a non-buffered `write`.