Always print the port (even if it's the standard 80/443)
MODIFY
urllib3/connectionpool.py
urllib3/connectionpool.py
@@ -204,9 +204,9 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
Return a fresh :class:`HTTPConnection`.
"""
self.num_connections += 1
- log.debug("Starting new HTTP connection (%d): %s%s",
+ log.debug("Starting new HTTP connection (%d): %s:%s",
self.num_connections, self.host,
- ":%s" % self.port if (self.port and self.port != 80) else "")
+ self.port if self.port else "80")
conn = self.ConnectionCls(host=self.host, port=self.port,
timeout=self.timeout.connect_timeout,
@@ -821,9 +821,9 @@ class HTTPSConnectionPool(HTTPConnectionPool):
Return a fresh :class:`httplib.HTTPSConnection`.
"""
self.num_connections += 1
- log.debug("Starting new HTTPS connection (%d): %s%s",
+ log.debug("Starting new HTTPS connection (%d): %s:%s",
self.num_connections, self.host,
- ":%s" % self.port if (self.port and self.port != 443) else "")
+ self.port if self.port else "443")
if not self.ConnectionCls or self.ConnectionCls is DummyConnection:
raise SSLError("Can't connect to HTTPS URL because the SSL "

Always print the port (even if it's the standard 80/443)