From: dirk.meier.eickhoff+ruby-lang@... Date: 2018-09-25T15:50:40+00:00 Subject: [ruby-core:89164] [Ruby trunk Bug#15160] ArgumentError: year too big to marshal Issue #15160 has been reported by Dirk (Dirk Meier-Eickhoff). ---------------------------------------- Bug #15160: ArgumentError: year too big to marshal https://bugs.ruby-lang.org/issues/15160 * Author: Dirk (Dirk Meier-Eickhoff) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-darwin17] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- I encountered the problem, that marshaling a Time object does not always work. Try run following commands in irb that will raise an error: ~~~ ruby Marshal.dump(Time.new(1900)) #Traceback (most recent call last): # 3: from (irb):35 # 2: from (irb):35:in `dump' # 1: from (irb):35:in `_dump' #ArgumentError (year too big to marshal: 1899 UTC) Marshal.dump(Time.new(1899)) #Traceback (most recent call last): # 3: from (irb):37 # 2: from (irb):37:in `dump' # 1: from (irb):37:in `_dump' #ArgumentError (year too big to marshal: 1898 UTC) ~~~ Following commands will work fine: ~~~ ruby Marshal.dump(Time.new(1901)) # => "\x04\bIu:\tTime\r\xF7/\x00\x80\x00\x00\x00\x00\a:\voffseti\x02\x10\x0E:\tzoneI\"\bCET\x06:\x06EF" Marshal.dump(Date.new(1899)) # => "\x04\bU:\tDate[\vi\x00i\x03@\xD8$i\x00i\x00i\x00f\f2299161" ~~~ I'm in timezone CEST (UTC+2). I tested it at MacOS High Sierra (10.13.6 (17G65)) and Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-135-generic x86_64) with two Ruby versions: - ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17] - ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-darwin17] I expect that all Time objects can be marshaled, even if they are prior 1900. -- https://bugs.ruby-lang.org/ Unsubscribe: