In this commit https://github.com/pypa/setuptools/commit/3a351aa00e2110c3b3df0302b1ed6bcf66a1f8d8 is used host instead of netloc, but host does not contain port. Version 40.6.3 works OK.