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

Fix Marshal.load ArgumentError on ruby3.3 #23219

Conversation

agrare
Copy link
Member

@agrare agrare commented Oct 1, 2024

I ran into this using tab-complete in a rails console on ruby 3.3. It appears that rdoc is passing a proc to Marshal.load and that is causing our initializer monkeypatch to fail.

config/initializers/marshal_autoloader.rb:6:in `load': wrong number of arguments (given 2, expected 1) (ArgumentError)
	from /usr/lib/ruby/3.3.0/rdoc/store.rb:974:in `block in marshal_load'
	from /usr/lib/ruby/3.3.0/rdoc/store.rb:974:in `open'

@agrare agrare requested a review from jrafanie as a code owner October 1, 2024 20:04
@jrafanie jrafanie closed this Oct 2, 2024
@jrafanie jrafanie reopened this Oct 2, 2024
@jrafanie
Copy link
Member

jrafanie commented Oct 2, 2024

Closed / open after merge of #23220

```
config/initializers/marshal_autoloader.rb:6:in `load': wrong number of arguments (given 2, expected 1) (ArgumentError)
	from /usr/lib/ruby/3.3.0/rdoc/store.rb:974:in `block in marshal_load'
	from /usr/lib/ruby/3.3.0/rdoc/store.rb:974:in `open'
```
@agrare agrare force-pushed the fix_marshal_load_argument_error_tab_complete_ruby_3_3 branch from 9368320 to abc8013 Compare October 2, 2024 13:29
@@ -3,7 +3,7 @@
# processes or load just the classes that are marshaled, which may be far less classes and locations than when
# we originally wrote this initializer.
module MarshalAutoloader
def load(data)
def load(data, _proc = nil)
Copy link
Member

Choose a reason for hiding this comment

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

haha, I was just about to comment to add that = nil!

Great minds think alike.

@miq-bot
Copy link
Member

miq-bot commented Oct 2, 2024

Checked commit agrare@abc8013 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@jrafanie jrafanie self-assigned this Oct 2, 2024
@jrafanie jrafanie merged commit ff7d2c9 into ManageIQ:master Oct 2, 2024
12 checks passed
@agrare agrare deleted the fix_marshal_load_argument_error_tab_complete_ruby_3_3 branch October 2, 2024 14:14
@kbrock kbrock mentioned this pull request Nov 5, 2024
78 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants