Skip to content

[requests] requests.exceptions.JSONDecodeError inherits from json.JSONDecodeError#15168

Merged
hauntsaninja merged 1 commit intopython:mainfrom
jceresini:main
Jan 6, 2026
Merged

[requests] requests.exceptions.JSONDecodeError inherits from json.JSONDecodeError#15168
hauntsaninja merged 1 commit intopython:mainfrom
jceresini:main

Conversation

@jceresini
Copy link
Copy Markdown
Contributor

@jceresini jceresini commented Dec 23, 2025

Addresses: #15167

Technically, it inherits from either json.JSONDecodeError or simplejson.errors.JSONDecodeError, but the latter is compatible: https://github.com/simplejson/simplejson/blob/master/simplejson/errors.py#L41-L47

I've included a test that fails prior to the changes to stubs/requests/requests/exceptions.pyi but passes now.

@github-actions

This comment has been minimized.

@jceresini jceresini changed the title [requests] requests.exceptions.JSONDecodeError inherits from json.JNDecodeError [requests] requests.exceptions.JSONDecodeError inherits from json.JSONDecodeError Dec 23, 2025
@github-actions

This comment has been minimized.

Comment thread CONTRIBUTING.md Outdated
Comment thread stubs/requests/@tests/test_cases/check_jsondecodeerror.py Outdated
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@jceresini jceresini requested a review from srittau January 6, 2026 01:09
Copy link
Copy Markdown
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hauntsaninja hauntsaninja merged commit 9b5f515 into python:main Jan 6, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants