Marshal bug

Running the latest pragprog build:

$ cat test.rb
p Marshal.load(Marshal.dump(‘hello world’))
a = File.new(‘test’, ‘w’)
Marshal.dump(‘hello world’, a)
b = Marshal.load(‘test’)
p b

$ ruby test.rb
"hello world"
test.rb:4:in `load’: incompatible marshal file format (can’t be read) (TypeError)
format version 4.8 required; 116.101 given
from test.rb:4

$ ruby -v
ruby 1.7.3 (2002-11-17) [i386-mswin32]

$

b = Marshal.load('test')

svg% ri Marshal::load
---------------------------------------------------------- Marshal::load
     load( from [, aProc] ) -> anObject

···

------------------------------------------------------------------------
     Returns the result of converting the serialized data in from into a
     Ruby object (possibly with associated subordinate objects). from
     may be either an instance of IO or an object that responds to
     to_str. If proc is specified, it will be passed each object as it
     is deserialized.

svg%

ruby try to load objects from the String "test"

Guy Decoux

DOH!!!

Thanks :slight_smile:

martin

···

ts decoux@moulon.inra.fr wrote:

ruby try to load objects from the String “test”