URL ports have to be decimal digits.

RFC 3986 section 3.2.3.
Treat empty port in URL the same as absent.

RFC 3986 says that these URLs are equivalent:

http://example.com/
http://example.com:/

url.parse was returning port="" for the latter. Make it instead return
port=nil like the former.