Skip to content

Bug fix: Update benchmarks/Python/json.py#102

Merged
smarr merged 3 commits intosmarr:masterfrom
paudsu01:json-fix
Oct 23, 2025
Merged

Bug fix: Update benchmarks/Python/json.py#102
smarr merged 3 commits intosmarr:masterfrom
paudsu01:json-fix

Conversation

@paudsu01
Copy link
Contributor

No description provided.

@paudsu01
Copy link
Contributor Author

The _read_array method in the _Parser class should raise an exception if the ending char at the end isn't "]".
Currently, it creates an exception object, but it doesn't throw the exception. This PR fixes that.

@smarr
Copy link
Owner

smarr commented Oct 22, 2025

@paudsu01 thank you for the PR, this indeed looks like a bug porting the benchmark.
Did you by any chance check the other languages? I had a quick look at JavaScript and Java, there this already seems to throw correctly.

Thanks!

@smarr smarr added the bug label Oct 22, 2025
@paudsu01
Copy link
Contributor Author

Hi, I just checked the other languages as well. Except for Python, I believe all of them throw the exception.


The smalltalk/SOM/SOMns JSON benchmarks have the following code:

(self readChar: ']') ifFalse: [
self expected: '"," or "]"'
].

Not familiar with code syntax or semantics, but this self expected : msg is the same pattern I see in other places where an exception is(should be) raised as well in the code. So, I am assuming this will throw the exception.

@smarr
Copy link
Owner

smarr commented Oct 23, 2025

@paudsu01 thanks a lot. I also had a look, and indeed, it was the only place where the raise/throw or similar was missing.

I pushed some CI updates to make one of the languages pass.

Will merge!

@smarr smarr merged commit 50e34b1 into smarr:master Oct 23, 2025
22 checks passed
@paudsu01 paudsu01 deleted the json-fix branch October 30, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants