Issue #6625 has been updated by shyouhei (Shyouhei Urabe).


tadf (tadayoshi funaba) wrote:
> should we still support 1.8 dump?

Yes please.  We no longer need to write old formats, but I still need to read.  Otherwise I cannot convert them into new formats.
----------------------------------------
Bug #6625: broken Marshal compatibilities on Complex and Rational
https://bugs.ruby-lang.org/issues/6625#change-27387

Author: nobu (Nobuyoshi Nakada)
Status: Assigned
Priority: Low
Assignee: tadf (tadayoshi funaba)
Category: core
Target version: 2.0.0
ruby -v: 2.0.0


=begin
(({Complex})) and (({Rational})) dumped by 1.8 or earlier cannot be loaded by trunk.

  $ /usr/bin/ruby -v
  ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

  $ ruby -v
  ruby 2.0.0dev (2012-06-22 trunk 36175) [universal.x86_64-darwin11]

  $ /usr/bin/ruby -rcomplex -e 'Marshal.dump(Complex(0, 0), STDOUT)' | ruby -e 'p Marshal.load(STDIN)'
  -e:1:in `load': dump format error (ArgumentError)
  	from -e:1:in `<main>'
  bash: exit 1

  $ /usr/bin/ruby -rrational -e 'Marshal.dump(Rational(0), STDOUT)' | ruby -e 'p Marshal.load(STDIN)'
  -e:1:in `load': dump format error (ArgumentError)
  	from -e:1:in `<main>'
  bash: exit 1

Patch attached.
=end



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