MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/netrc.py:67–78  ·  view source on GitHub ↗
(self, file=None)

Source from the content-addressed store, hash-verified

65
66class netrc:
67 def __init__(self, file=None):
68 default_netrc = file is None
69 if file is None:
70 file = os.path.join(os.path.expanduser("~"), ".netrc")
71 self.hosts = {}
72 self.macros = {}
73 try:
74 with open(file, encoding="utf-8") as fp:
75 self._parse(file, fp, default_netrc)
76 except UnicodeDecodeError:
77 with open(file, encoding="locale") as fp:
78 self._parse(file, fp, default_netrc)
79
80 def _parse(self, file, fp, default_netrc):
81 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