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

Add port to connection open print if it's non standard (not 80 or 443)