Project

General

Profile

Actions

Bug #2627

closed

incompatibility of Marshal of Time with nanosecond

Added by mame (Yusuke Endoh) almost 15 years ago. Updated over 13 years ago.

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

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
=end

Actions #1

Updated by mame (Yusuke Endoh) almost 15 years ago

  • Category set to core
  • Priority changed from 3 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

Actions #2

Updated by akr (Akira Tanaka) almost 15 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

Actions

Also available in: Atom PDF

Like0
Like0Like0