Bug #2627

incompatibility of Marshal of Time with nanosecond

Added by Yusuke Endoh over 5 years ago. Updated almost 4 years ago.

[ruby-dev:40133]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.2dev (2010-01-21 trunk 26367) [i686-linux] Backport:

Description

=begin
遠藤です。

ナノ秒の情報を含む Time について、1.9.1-p378 で Marshal.dump したものを
trunk で load すると、情報が落ちるようです。

# ruby-1.9.1-p378 で書きだす
$ ruby-1.9.1-p378 -e '
t = Time.at(Math::PI)
p t.nsec
open("t", "wb") {|f| f.write(Marshal.dump(t)) }
'
141592654

# ruby-1.9.1-p378 なら読める
$ ruby-1.9.1-p378 -e 'p Marshal.load(File.binread("t")).nsec'
141592654

# trunk だと下 3 桁くらいが落ちる
$ ./ruby -e 'p Marshal.load(File.binread("t")).nsec'
141592000

--
Yusuke ENDOH mame@tsg.ne.jp
=end

History

#1 Updated by Yusuke Endoh over 5 years ago

  • Category set to core
  • Priority changed from Low to Normal
  • Target version set to 2.0.0
  • ruby -v set to ruby 1.9.2dev (2010-01-21 trunk 26367) [i686-linux]

=begin

=end

#2 Updated by Akira Tanaka over 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26377.
Yusuke, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF