Project

General

Profile

Actions

Bug #11884

closed

Psych.load broken for OpenStruct in Ruby 2.3.0

Added by kaikuchn (Kai Kuchenbecker) almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
[ruby-core:72501]

Description

Deserialising an OpenStruct through Psych::load results in a nil error since OpenStruct now has a respond_to_missing? method whose implementation references OpenStruct's @table instance variable.

To reproduce this issue simply use Psych to dump an OpenStruct and then load it again via Psych::load. I attached an example script that does exactly this. I have also attached the error output I get when running this script.

I'm not sure whether to assign marcandre or tenderlove... Please tell me if you need any further information.

Best regards,
Kai


Files

psych_error.rb (99 Bytes) psych_error.rb Script to reproduce error kaikuchn (Kai Kuchenbecker), 12/27/2015 12:40 AM
psych_error.log (1.54 KB) psych_error.log Error output of Psych.load for OpenStruct kaikuchn (Kai Kuchenbecker), 12/27/2015 12:40 AM
syck_error.rb (101 Bytes) syck_error.rb PSchambacher (Pierre Schambacher), 04/26/2016 05:56 PM
syck_error.log (635 Bytes) syck_error.log PSchambacher (Pierre Schambacher), 04/26/2016 05:56 PM

Related issues 4 (0 open4 closed)

Related to Ruby master - Bug #13358: OpenStruct overriding allocateClosedEregon (Benoit Daloze)Actions
Has duplicate Ruby master - Bug #11966: YAML#load fails with OpenStruct objectClosedActions
Has duplicate Ruby master - Bug #12140: Serialization of OpenStruct objects with YAML failsClosedActions
Has duplicate Ruby master - Bug #12349: Can't load OpenStruct with Syck with Ruby 2.3.xClosedtenderlovemaking (Aaron Patterson)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0