Skip to content
Myr

Ignore PermissionError in netrc_info() (#1104)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Ignore PermissionError in netrc_info()

authored by Tom Christie · committed by GitHub · parent 31e587c · Browse files · 1 file+7 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−3 removed

  • other:+7 added−3 removed

1 file+7 added−3 removed

modified:httpx/_utils.py+7 added-3 removed
137 unmodified lines
138 if not hasattr(self, "_netrc_info"):139 self._netrc_info = None140 for file_path in self.netrc_files:141 expanded_path = Path(file_path).expanduser()142 try:142 if expanded_path.is_file():143 self._netrc_info = netrc.netrc(str(expanded_path))144 break143 if expanded_path.is_file():144 self._netrc_info = netrc.netrc(str(expanded_path))145 break146 except (netrc.NetrcParseError, IOError): # pragma: nocover147 # Issue while reading the netrc file, ignore...148 pass149 return self._netrc_info150151 def get_credentials(152 self, authority: str
281 unmodified lines