-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2781: deprecate ClientResponseError.code in favor of .status #2818
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2818 +/- ##
==========================================
+ Coverage 97.97% 97.98% +<.01%
==========================================
Files 39 39
Lines 7376 7391 +15
Branches 1295 1299 +4
==========================================
+ Hits 7227 7242 +15
Misses 47 47
Partials 102 102
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contribution.
Please add a case when both status and code are passed to constructor and update documentation: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientResponseError
aiohttp/client_exceptions.py
Outdated
warnings.warn("code argument is deprecated, use status instead", | ||
DeprecationWarning, | ||
stacklevel=2) | ||
if status == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add two a couple lines for raising ValueError
if both code
and status
are provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is good, docs are left
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
What do these changes do?
Deprecate ClientResponseError.code in favor of .status
Are there changes in behavior for the user?
ClientResponseError.code is deprecated, but continues to work
Related issue number
#2781
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change 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.