I can look at this later tonight, if you haven't already fixed it.
btw, I recall seeing this commit (non-merged) from @hltbra recently
https://github.com/hltbra/pip/commit/c4a6438888f8e719dad34e3d3d5de82183b136e0