Ignore PermissionError in netrc_info()#810
Conversation
I'm running uWSGI, the user is "nobody", the netrc_file should be '~/.netrc'. But I don't know why, the location trunes out to be '/root/.netrc', so a PermissionError raised, it's better to ignore this error instead of to raise.
|
Okay. It's not super clear if it'd be better for us to ignore this, or to raise it, to ensure the user is aware of the issue. You can disable I suppose we should probably follow requests' lead here and silently ignore The build on this pull request is currently failing due to linter errors - make sure to run |
florimondmanca
left a comment
There was a problem hiding this comment.
Thanks! A couple of suggestions from me.
|
@Jonney Also, were you able to debug this by using the |
It's ugly to use trust_env=False every time, if so, I want to use Requests instead of httpx |
Yes, it is. You can use a client = httpx.Client(trust_env=False)
response = client.get('https://example.org')async with httpx.AsyncClient(trust_env=False) as client:
response = await client.get('https://example.org')
Also, that suggestion was meant as a workaround, not a permanent solution. |
ignore (netrc.NetrcParseError, IOError, PermissionError)
Co-Authored-By: Stephen Brown II <Stephen.Brown2@gmail.com>
Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>
|
Thanks so much! Now closed, see #1104 |
I'm running uWSGI, the user is "nobody", the netrc_file should be '~/.netrc'.
But I don't know why, the location trunes out to be '/root/.netrc', so a PermissionError raised, it's better to ignore this error instead of to raise.