pypa/pip — pull request #606 by philwhln (2012-07-18 06:10:02+00:00)
Title: stop get_mirrors returning 216k invalid hostname from Japan

This solves issue 605

>>> from pip.index import get_mirrors

From Japan, when last.pypi.python.org resolves to last.pypi.python.org, revert to z.pypi.python.org, since last.pypi.python.org results in 216k invalid hostnames.

>>> get_mirrors()
['a.pypi.python.org', 'b.pypi.python.org', 'c.pypi.python.org', 'd.pypi.python.org', 'e.pypi.python.org', 'f.pypi.python.org', 'g.pypi.python.org', 'h.pypi.python.org', 'i.pypi.python.org', 'j.pypi.python.org', 'k.pypi.python.org', 'l.pypi.python.org', 'm.pypi.python.org', 'n.pypi.python.org', 'o.pypi.python.org', 'p.pypi.python.org', 'q.pypi.python.org', 'r.pypi.python.org', 's.pypi.python.org', 't.pypi.python.org', 'u.pypi.python.org', 'v.pypi.python.org', 'w.pypi.python.org', 'x.pypi.python.org', 'y.pypi.python.org', 'z.pypi.python.org']

From Vancouver, Canada the same call resolves ok, so fallback is not needed...

>>> get_mirrors()
['a.pypi.python.org', 'b.pypi.python.org', 'c.pypi.python.org', 'd.pypi.python.org', 'e.pypi.python.org', 'f.pypi.python.org', 'g.pypi.python.org']

This stops my machine spinning like crazy with the 216K invalid mirror hostnames.