Using a kickstart file with the following repo entry: repo --name=VT --baseurl=http://somehost.example.com:80//ks/dist/ks-rhel-i386-server-5-u3/VT/repodata/repomd.xml and a %packages entry with: %packages xen generates a request from anaconda to the server with an incorrect Host header: GET //ks/dist/ks-rhel-i386-server-5-u3/VT/repodata/repomd.xml HTTP/1.1 Accept-Encoding: identity Host: ks Connection: close User-agent: urlgrabber/3.1.0 yum/3.2.19 note the Host: ks instead of the actual server. This caused the server that was hosting the repo's data to respond with a 404. If we correct the kickstart file to not contain the double slashes after the port: repo --name=VT --baseurl=http://somehost.example.com:80/ks/dist/ks-rhel-i386-server-5-u3/VT/repodata/repomd.xml it works fine. We changed our application to ensure that our kickstart files do not contain the // but it took us a while to realize those double slashes were causing breakage.
We just pass the baseurl down to yum, which probably does some mangling of it before passing it down into python's urllib/urlgrabber/whatever. It's probably worth doing sanitizing of the URL at some lower level than anaconda to make sure the whole system benefits from it.
Also the only thing I know that does anything "funny" with URLs is fastestmirror, and that does: host = lambda mirror: mirror.split('/')[2].split('@')[-1] ...which works fine. AFAIK everything else in yum/urlgrabber uses urlparse.urlparse(). Can you reproduce this with plain yum?