-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-137821: Improve Argument Clinic definitions in the _json module
#140780
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
Conversation
| @@ -0,0 +1,2 @@ | |||
| Convert ``_json`` module to use Argument Clinic. | |||
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.
@StanFromIreland Moved.
| def test_overflow(self): | ||
| with self.assertRaises(OverflowError): | ||
| self.json.decoder.scanstring(b"xxx", sys.maxsize+1) | ||
| self.json.decoder.scanstring("xxx", sys.maxsize+1) |
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.
This was wrongly tested.
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.
See:
Python 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.decoder.scanstring(b"xxx", 10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: first argument must be a string, not bytes
_json module
_jsonto Argument Clinic #137821