Skip to content
Myr

Don't bonk if .netrc isn't readable.

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

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.

authored by Ben · committed by Ben · parent 99a6074 · Browse files · 1 file+3 added−1 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+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:requests/utils.py+3 added-1 removed
48 unmodified lines
49 if _netrc:50 # Return with login / password51 login_i = (0 if _netrc[0] else 1)52 return (_netrc[login_i], _netrc[2])53 except NetrcParseError:53 except NetrcParseError, IOError:54 # If there was a parsing error or a permissions issue reading the file,55 # we'll just skip netrc auth56 pass575859def dict_from_string(s):
399 unmodified lines