[ruby-core:67247] [ruby-trunk - Bug #10496] Yaml: Serialization of cross-referrenced objects with psych

From: duerst@...
Date: 2014-12-31 06:27:52 UTC
List: ruby-core #67247
Issue #10496 has been updated by Martin D=C3=BCrst.

Assignee changed from ruby-core to Aaron Patterson

----------------------------------------
Bug #10496: Yaml: Serialization of cross-referrenced objects with psych
https://bugs.ruby-lang.org/issues/10496#change-50718

* Author: Ivan Neverov
* Status: Open
* Priority: Normal
* Assignee: Aaron Patterson
* Category: ext
* Target version:=20
* ruby -v: 2.1.3p242, 1.9.3p550
* Backport:=20
----------------------------------------
I'm trying to run next code that serialize object B that has instance varia=
ble of A initialized with this B (cross referenced). After deserialization =
I'm getting 2 B objects instead of 1

https://gist.github.com/ineverov/3ce3ea21d970996b673e

During investigation of source code of psych I found that we don't register=
 objects that use encode_with methods
Here: https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/visitors/=
yaml_tree.rb#L530





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

In This Thread

Prev Next