-
Notifications
You must be signed in to change notification settings - Fork 339
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_pure: Parser Constructor Error With Ruby 3.3.5 Using Version 2.7.4 #651
Comments
Hum, this is weird. >> gem 'json_pure'
=> true
>> require 'json/pure'
=> true
>> JSON.parse('{}', symbolize_names: true)
=> {}
>> JSON::VERSION
=> "2.7.4"
>> JSON.parser
=> JSON::Ext::Parser
>> JSON.parser = JSON::Pure::Parser
=> JSON::Pure::Parser
>> JSON.parse('{}', symbolize_names: true) Any chance you'd have a reproduction script of some sort? Or at the very least put some debug statements in there to understand what Because I don't see how |
Hi. Sorry I don't have a way to easily reproduce since it's not my code (instead it's code coverage report being executed via rake). |
Right, but this is happening on your machine, right? If you you can |
Yea, I should/could. I just got home from hospital form major wrist surgery and can barely type. The issue does not occur with version 2.7.3 if that helps. It's definitely specific to 2.7.4. |
No need to justified yourself, my requests do imply a "whenever you get the chance". Hope you feel better soon.
That does help narrow it down, thank you. |
Ok, I think I know what's up. I bet Ref: #650 |
I don't have the json gem specified, actually. Is that what I need to do?
|
No need, I found a repro: require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'json_pure', "2.7.4"
gem 'json', "~> 2.6.0"
end
require 'json/ext'
require 'json/pure'
JSON.parser = JSON::Ext::Parser
JSON.parse('{}', symbolize_names: true)
You can rest your wrist :)
It probably is the stdlib version, I'll try to adjust my repro. |
Yep, even simpler: require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'json_pure', "2.7.4"
end
require 'json'
JSON.parse('{}', symbolize_names: true) |
Nice. You nailed it! |
Yeah, I'll have to cut a Thank you very much for the bug report. |
Thank you for the quick fix! |
Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs. So if json_pure 2.7.4 is loaded with `json <= 2.7.2` (or stdlib) it blows up. Ref: ruby/json#650 Fix: ruby/json#651 ruby/json@4d9dc98817
Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs. So if json_pure 2.7.4 is loaded with `json <= 2.7.2` (or stdlib) it blows up. Ref: ruby/json#650 Fix: ruby/json#651 ruby/json@4d9dc98817
Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs. So if json_pure 2.7.4 is loaded with `json <= 2.7.2` (or stdlib) it blows up. Ref: ruby/json#650 Fix: ruby/json#651 ruby/json@4d9dc98817
Started getting the following error after upgrading to version 2.7.4 using Ruby 3.3.5. This error does not occur with version 2.7.2 that I rolled back to:
/Users/john/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/json_pure-2.7.4/lib/json/common.rb:222:in `initialize': wrong number of arguments (given 2, expected 1) (ArgumentError)
The text was updated successfully, but these errors were encountered: