Well we know what the issue is: Python's urllib2 is busted. So someone needs to
either fix it in Python or work around it in hg. It might be possible to do the
latter with something like
http://code.activestate.com/recipes/456195/
but I'm not in a position to test it.