MCPcopy Index your code
hub / github.com/python/cpython / connect_ftp

Method connect_ftp

Lib/urllib/request.py:1585–1595  ·  view source on GitHub ↗
(self, user, passwd, host, port, dirs, timeout)

Source from the content-addressed store, hash-verified

1583 self.max_conns = m
1584
1585 def connect_ftp(self, user, passwd, host, port, dirs, timeout):
1586 key = user, host, port, '/'.join(dirs), timeout
1587 conn = self.cache.get(key)
1588 if conn is None or not conn.keepalive:
1589 if conn is not None:
1590 conn.close()
1591 conn = self.cache[key] = ftpwrapper(user, passwd, host, port,
1592 dirs, timeout)
1593 self.timeout[key] = time.time() + self.delay
1594 self.check_cache()
1595 return conn
1596
1597 def check_cache(self):
1598 # first check for old ones

Callers

nothing calls this directly

Calls 6

check_cacheMethod · 0.95
ftpwrapperClass · 0.85
joinMethod · 0.45
getMethod · 0.45
closeMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected