From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 597F91F62E for ; Tue, 15 Jan 2019 08:54:22 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id EE6FD121379; Tue, 15 Jan 2019 17:54:19 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id D2D461210E3 for ; Tue, 15 Jan 2019 17:54:16 +0900 (JST) Received: by filter0096p3las1.sendgrid.net with SMTP id filter0096p3las1-14005-5C3D9FB6-4A 2019-01-15 08:54:15.03904185 +0000 UTC m=+40123.123664911 Received: from herokuapp.com (ec2-54-92-132-214.compute-1.amazonaws.com [54.92.132.214]) by ismtpd0003p1iad2.sendgrid.net (SG) with ESMTP id 6kqB-fMoQnmgL0wwp7_Vyg for ; Tue, 15 Jan 2019 08:54:14.643 +0000 (UTC) Date: Tue, 15 Jan 2019 08:54:15 +0000 (UTC) From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66547 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15506 X-Redmine-Issue-Author: v49564 X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5eaWAO5YfUa/NFbHVY1Yh97cXvQBWg4wrVvX HSTXKNrJjULLWAHB2cgYchQCfFFIsunct1Ml5SepIP/9bKQI8zoOfgd9f1pd8qaoxCTwpKc6it+pOa fGIBbAasoE7jUqwBlGeXRvEUp4BXTMKUw0B55DJOps2JniOsnYFbVZCxIA== X-ML-Name: ruby-core X-Mail-Count: 91096 Subject: [ruby-core:91096] [Ruby trunk Bug#15506] ArgumentError on some ordinal dates X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15506 has been updated by naruse (Yui NARUSE). Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE ruby_2_6 r66825 merged revision(s) 66735. ---------------------------------------- Bug #15506: ArgumentError on some ordinal dates https://bugs.ruby-lang.org/issues/15506#change-76332 * Author: v49564 (Victor Bruley) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE ---------------------------------------- Seems the bug was introduced with r64028: Adding the difference between two ordinal dates (source:lib/time.rb#L210 : `day += diff`) results in month days superior to 31 for dates at the beginning of a month, causing the out of range error. ~~~ require "time" Time.strptime("91095", "%y%j") => 1991-04-05 00:00:00 -0400 Time.strptime("91093", "%y%j") Traceback (most recent call last): 4: from lib/ruby/2.6.0/time.rb:451:in `strptime' 3: from lib/ruby/2.6.0/time.rb:211:in `make_time' 2: from lib/ruby/2.6.0/time.rb:257:in `make_time' 1: from lib/ruby/2.6.0/time.rb:257:in `local' ArgumentError (argument out of range) ~~~ -- https://bugs.ruby-lang.org/