Comment 1 for bug 150860

Revision history for this message
Vincent Ladeuil (vila) wrote :

Martin suggested:

When parsing a url, if no port is specified, leave it as None in the
parsed tuple or transport. When unparsing them, None goes back to
unspecified and any explicit port, even the default, is explicitly
shown.

The default port only comes in at the point of opening the network
socket if it's still None -- often this will be done inside pycurl or
something rather than bzrlib.

The only drawback is that if we ever get proto://foo/ and
proto://foo:defaultport/ they won't be parsed the same way. We can
specifically list which protocols can or can't do this. On the other
hand I'm not sure it's really critical - if we just keep urls as
they're passed in, then we should rarely see http://host:80/ with the
port number.