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

Method __init__

Lib/netrc.py:80–91  ·  view source on GitHub ↗
(self, file=None)

Source from the content-addressed store, hash-verified

78
79class netrc:
80 def __init__(self, file=None):
81 default_netrc = file is None
82 if file is None:
83 file = os.path.join(os.path.expanduser("~"), ".netrc")
84 self.hosts = {}
85 self.macros = {}
86 try:
87 with open(file, encoding="utf-8") as fp:
88 self._parse(file, fp, default_netrc)
89 except UnicodeDecodeError:
90 with open(file, encoding="locale") as fp:
91 self._parse(file, fp, default_netrc)
92
93 def _parse(self, file, fp, default_netrc):
94 lexer = _netrclex(fp)

Callers 1

__init__Method · 0.45

Calls 4

_parseMethod · 0.95
expanduserMethod · 0.80
openFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected