* Ignore PermissionError in netrc_info()
self._netrc_info = None
for file_path in self.netrc_files:
expanded_path = Path(file_path).expanduser()
- if expanded_path.is_file():
- self._netrc_info = netrc.netrc(str(expanded_path))
- break
+ try:
+ if expanded_path.is_file():
+ self._netrc_info = netrc.netrc(str(expanded_path))
+ break
+ except (netrc.NetrcParseError, IOError): # pragma: nocover
+ # Issue while reading the netrc file, ignore...
+ pass
return self._netrc_info
def get_credentials(