Skip to content

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Oct 30, 2025

@corona10
Copy link
Member Author

cc @StanFromIreland

@@ -0,0 +1,2 @@
Convert ``_json`` module to use Argument Clinic.
Copy link
Member Author

Choose a reason for hiding this comment

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

@corona10 corona10 changed the title gh-137821: Improve Argument Clinic definitions in the _json module [WIP] gh-137821: Improve Argument Clinic definitions in the _json module Oct 30, 2025
@corona10 corona10 changed the title [WIP] gh-137821: Improve Argument Clinic definitions in the _json module gh-137821: Improve Argument Clinic definitions in the _json module Oct 30, 2025
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)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was wrongly tested.

Copy link
Member Author

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

@corona10 corona10 enabled auto-merge (squash) October 30, 2025 10:07
@corona10 corona10 changed the title gh-137821: Improve Argument Clinic definitions in the _json module gh-137821: Improve Argument Clinic definitions in the _json module Oct 30, 2025
@corona10 corona10 disabled auto-merge October 30, 2025 10:18
@corona10 corona10 enabled auto-merge (squash) October 30, 2025 10:18
@corona10 corona10 merged commit c45e6e1 into python:main Oct 30, 2025
46 checks passed
@corona10 corona10 deleted the gh-137821-nit branch October 30, 2025 11:29
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.

2 participants