Fix PermissionError when loading .netrc (#7237) (#7378)#7395
Merged
Dreamsorcerer merged 1 commit intoaio-libs:3.8from Jul 22, 2023
Conversation
## What do these changes do? If no NETRC environment variable is provided and the .netrc path cannot be accessed due to missing permission, a PermissionError was raised instead of returning None. See issue aio-libs#7237. This PR fixes the issue. If the changes look good, I can also prepare backports. ## Are there changes in behavior for the user? If the .netrc cannot be accessed due to a permission problem (and the `NETRC` environment variable is unset), no `PermissionError` will be raised. Instead it will be silently ignored. ## Related issue number Fixes aio-libs#7237 (cherry picked from commit 0d2e43b) # Conflicts: # CONTRIBUTORS.txt # aiohttp/helpers.py # tests/test_helpers.py
4e559e8 to
1046a34
Compare
Contributor
Author
|
I think the failure of "CI / Test (macos, 3.11.0-alpha - 3.11.0, true, Y) (pull_request)" is unrelated to the changes. The log says: |
Codecov Report
@@ Coverage Diff @@
## 3.8 #7395 +/- ##
==========================================
+ Coverage 97.29% 97.38% +0.09%
==========================================
Files 107 107
Lines 31012 31029 +17
Branches 3245 3931 +686
==========================================
+ Hits 30173 30218 +45
+ Misses 629 606 -23
+ Partials 210 205 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
If no NETRC environment variable is provided and the .netrc path cannot be accessed due to missing permission, a PermissionError was raised instead of returning None. See issue #7237. This PR fixes the issue.
If the changes look good, I can also prepare backports.
Are there changes in behavior for the user?
If the .netrc cannot be accessed due to a permission problem (and the
NETRCenvironment variable is unset), noPermissionErrorwill be raised. Instead it will be silently ignored.Related issue number
Fixes #7237
Backport of #7378
(cherry picked from commit 0d2e43b)
Checklist
CONTRIBUTORS.txtCHANGESfolder<issue_id>.<type>for example (588.bugfix)issue_idchange it to the pr id after creating the pr.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.