It's possible in some shared hosting environments that the .netrc file isn't readable by the user for the calling process. In that circumstance, just forgo the netrc authentication.
# Return with login / password
login_i = (0 if _netrc[0] else 1)
return (_netrc[login_i], _netrc[2])
- except NetrcParseError:
+ except NetrcParseError, IOError:
+ # If there was a parsing error or a permissions issue reading the file,
+ # we'll just skip netrc auth
pass