Issue #11884 has been reported by Kai Kuchenbecker.

----------------------------------------
Bug #11884: Psych.load broken for OpenStruct in Ruby 2.3.0
https://bugs.ruby-lang.org/issues/11884

* Author: Kai Kuchenbecker
* Status: Open
* Priority: Normal
* Assignee: Marc-Andre Lafortune
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Since OpenStruct now has a respond_to_missing? method that references the @table instance variable, Psych's load implementation for OpenStruct results in a nil error.
I noticed this since rbenv rehash uses this feature (see this github issue https://github.com/rbenv/rbenv/issues/845).

To reproduce this issue simply use Psych to dump an OpenStruct and then load it again through Psych, 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.log (1.54 KB)
psych_error.rb (99 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>