Skip to content
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

raise_for_status documentation is out of sync #6683

Closed
dennyb87 opened this issue Apr 14, 2024 · 4 comments
Closed

raise_for_status documentation is out of sync #6683

dennyb87 opened this issue Apr 14, 2024 · 4 comments

Comments

@dennyb87
Copy link

Not a bug per se, more like a discrepancy between documentation and actual behaviour.

Expected Result

The documentation says response.raise_for_status() should return the response for chaining in trivial use cases.

Screenshot from 2024-04-14 11-19-57

Actual Result

The code in the latest version of package doesn't actually allow it, see raise_for_status in models.py

Reproduction Steps

...
    response.raise_for_status().json()
AttributeError: 'NoneType' object has no attribute 'json'
ManiFaridi added a commit to ManiFaridi/requests that referenced this issue Apr 14, 2024
ManiFaridi added a commit to ManiFaridi/requests that referenced this issue Apr 14, 2024
@nateprewitt
Copy link
Member

Hi @dennyb87, thanks for raising this. I responded in a comment here in your PR. If you can provide examples from the official docs hosted on readthedocs, we'd be happy to fix this, but from what I can see currently, this never existed in the Requests documentation. What you provided above is an unmaintained fork we do not have control over.

@sigmavirus24
Copy link
Contributor

Nice catch @nateprewitt . I didn't have time to click through but the screenshot seemed convincing

@dennyb87
Copy link
Author

Ouch 🤦 that's embarrassing 😅 my bad! apologies for the annoyance 👋

@nateprewitt
Copy link
Member

No worries, thanks for checking in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants