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

JSON.pretty_generate generates different output to MRI for at least an empty hash #6338

Closed
chrisseaton opened this issue Jul 22, 2020 · 10 comments

Comments

@chrisseaton
Copy link
Contributor

require 'json'
puts JSON.pretty_generate({})
% chruby 2.5.7
% ruby -v test.rb 
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin19]
{
}
% chruby jruby 9.2.11.1
% ruby -v test.rb
jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 OpenJDK 64-Bit Server VM 25.252-b14 on 1.8.0_252-b14 +jit [darwin-x86_64]
{

}
@headius
Copy link
Member

headius commented Jul 28, 2020

I see in the other issue that it may be a behavior of json-pure, but in JRuby it ought to be loading the extension. Could be a behavioral change that was done to the C ext and never to the pure-Ruby or Java exts.

@headius
Copy link
Member

headius commented Jul 28, 2020

Could you re-file this with the json repo? We do not maintain that source here.

@chrisseaton
Copy link
Contributor Author

Do you know how can I tell what version of JSON has really been loaded? I don't see this error in the Java source, so not sure how I'm loading the pure version, if that's what is happening.

@chrisseaton
Copy link
Contributor Author

Sorry cancel - I was confused and the bug was in Java as well and I've fixed it in flori/json#449.

@headius
Copy link
Member

headius commented Oct 7, 2020

@chrisseaton Thanks for the patch! I can't review it or do anything to move it forward unfortunately, but once it's released we can update JRuby.

@headius
Copy link
Member

headius commented Oct 7, 2020

Actually, I can review... will do so now. Someone else will have to merge and release, though.

@chrisseaton
Copy link
Contributor Author

That's merged now. I'll close on anticipation you'll pick up the new version soon enough.

@headius
Copy link
Member

headius commented Dec 8, 2020

This has not been addressed yet since the change in flori/json#449 has not been released. We do not ship prerelease sources for default gems.

@chrisseaton In the future please don't close issues in our tracker unless they are actually resolved and targeted against a specific release. This one flew under the radar for 9.2.14 because it was closed without a release.

@headius headius reopened this Dec 8, 2020
@headius headius added this to the JRuby 9.3.0.0 milestone Dec 8, 2020
@headius
Copy link
Member

headius commented Dec 8, 2020

Marked for 9.3 since this is trivial and the fix has not yet been released. Could target 9.2.15 if the fix is released and we do that version before a 9.3 release.

@headius
Copy link
Member

headius commented Feb 2, 2021

Updated json for both 9.2 and 9.3 so this should be resolved now.

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

No branches or pull requests

2 participants