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=-4.0 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 4DD2A1F6A9 for ; Sat, 5 Jan 2019 17:29:01 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4C19E121608; Sun, 6 Jan 2019 02:28:57 +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 4C57D12160F for ; Sun, 6 Jan 2019 02:28:54 +0900 (JST) Received: by filter0046p3las1.sendgrid.net with SMTP id filter0046p3las1-31727-5C30E953-2 2019-01-05 17:28:51.143538699 +0000 UTC m=+64590.517245680 Received: from herokuapp.com (ec2-54-227-33-203.compute-1.amazonaws.com [54.227.33.203]) by ismtpd0010p1iad1.sendgrid.net (SG) with ESMTP id WAQ65LZ4RHio3ydXnj1sbg for ; Sat, 05 Jan 2019 17:28:50.993 +0000 (UTC) Date: Sat, 05 Jan 2019 17:28:52 +0000 (UTC) From: victor@scangeo.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66319 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15506 X-Redmine-Issue-Author: v49564 X-Redmine-Sender: v49564 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4zEbJ4A21QbZejPzTxBMNiHkVSTgTpd9YCnz TTdTCaVAA+V/NPcA3BoiBkS08EJiLiV8C5LdX6e3skEYJETmARG5UYjLuqHD9qi0lNvgv/crbGFeVa Bwj/3Rf9SkAFyGSd6ZQOYvn4PBI0hzvxsPAlW3bozkqC9dtdr/USrPuo3Q== X-ML-Name: ruby-core X-Mail-Count: 90897 Subject: [ruby-core:90897] [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 reported by v49564 (Victor Bruley). ---------------------------------------- Bug #15506: ArgumentError on some ordinal dates https://bugs.ruby-lang.org/issues/15506 * Author: v49564 (Victor Bruley) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- 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/