From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72570: 31.0.50; Regression in date-to-time Date: Tue, 13 Aug 2024 18:36:46 +0300 Message-ID: <8634n8h1td.fsf@gnu.org> References: <86zfpige7k.fsf@gnu.org> <892ebc72-1020-471a-bdcd-8e8da10d61dd@cs.ucla.edu> <86ikw4hdw2.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19714"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72570@debbugs.gnu.org, eggert@cs.ucla.edu To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 13 17:39:53 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sdtcl-0004fk-BI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Aug 2024 17:39:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdtcR-00026Y-2S; Tue, 13 Aug 2024 11:39:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdtcP-00026B-Jh for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:39:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdtcO-0007Kp-Af for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:39:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=xp8SINlq4guIsDAi4yFkXMiRJti5Th8TH0Td/r2rACI=; b=FxIVdQP7W+GMFmQL8lpMcu2AjA7vUTHDisKXUM9R5pzD67uZbK8oZX9rBjD4oLLVHYGxdBFUSU5QpmrKn5Fqz1Q0Cs++4wF1i0Nzwx/09xMoJpPZgdX+p4gEHIEA3QMHAEpmj577cF2W/EjT15Zee3IUE4pFnd3we5nKGx2s/EI2pUjy8svRYJAVXiIL0IT7vG1m0OF18CDsJxjtMktPmepQEHfKXkN3iY2wnH26+jTTvFc7MGLszxbXlE+VC1L/AOMtcNUx6mqELszhlOyW0lF7S18FN4fRde4AFbNa6cw2JsAhLk5Zxaw76AFGiXHMSZko623K+cs/aYhbhMy8yw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sdtcv-0004ID-Kr for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2024 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72570 X-GNU-PR-Package: emacs Original-Received: via spool by 72570-submit@debbugs.gnu.org id=B72570.172356358416456 (code B ref 72570); Tue, 13 Aug 2024 15:40:01 +0000 Original-Received: (at 72570) by debbugs.gnu.org; 13 Aug 2024 15:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:45401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdtcd-0004HL-IG for submit@debbugs.gnu.org; Tue, 13 Aug 2024 11:39:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdtca-0004Gx-Ru for 72570@debbugs.gnu.org; Tue, 13 Aug 2024 11:39:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdtZr-0007Be-2F; Tue, 13 Aug 2024 11:36:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xp8SINlq4guIsDAi4yFkXMiRJti5Th8TH0Td/r2rACI=; b=aDqkNm2+MQKC Pjl8okYmYoz709KQUrlYw8uoGpJNKdaKO/R3zuHXDHiMrZJJTsiMWWnj0AiYo2meA0WcRFNI8j5ir FOO1s2qTrfSco8Xe54kkJm62HQnlMgu1oVWlEmMWM61iL7iDEFjFOrtE1fCaMpZQV/LN4TOHDhrLz Sa8RBpUkQJR3yGVn+P/vnn2H75hijPVC4GS1nKnfC1OtSh8kudBKCcf3w/E20wIXLzxca611Zt2Kb KIKoPLEqV07lMdI/4A0sQMQpCTTKs8Wk6CC/5KTVh6gqj9G0hrYQrqwYpwiHV8mTk+qJk75VazOAA CB/9Rq6QAWu8i+QHh3KqIQ==; In-Reply-To: (message from Ulrich Mueller on Tue, 13 Aug 2024 17:09:14 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290083 Archived-At: > From: Ulrich Mueller > Cc: Paul Eggert , 72570@debbugs.gnu.org > Date: Tue, 13 Aug 2024 17:09:14 +0200 > > >>>>> On Tue, 13 Aug 2024, Eli Zaretskii wrote: > > > The change which affected behavior that triggered this discussion was > > done because evidently timezone-time-zone-from-absolute was deemed to > > be too slow, and therefore the authors of the change wanted to avoid > > it. I'm okay with making the result of that change the de-facto > > default, but then (a) we should document this change in NEWS including > > the (trivial) way of getting back old behavior, > > But what is the old behaviour? The one that is documented, or the actual > behaviour of the code? The former, IMO. It was also the actual behavior until that commit you found. > (format-time-string "%F %T" (date-to-time "2024-08-13 00:00:00")) > "2024-08-13 00:00:00" > > (format-time-string "%F %T" (date-to-time "2024-8-13 00:00:00")) > "2024-08-13 02:00:00" > > In the first case, parse-time-string (inside the first condition-case) > succeeds and it uses local time. In the second case with a slightly > malformed date, it takes the detour via timezone-make-date-arpa-standard > and uses UTC. That's my point (b), I believe: > > and (b) make sure that > > the new behavior happens even if the body of this condition-case in > > date-to-time: > > > (condition-case err > > (let ((parsed (parse-time-string date))) > > (when (decoded-time-year parsed) > > (decoded-time-set-defaults parsed)) > > (encode-time parsed)) > > > does not signal an error. > Also: > > (format-time-string "%F %T" (date-to-time "2024/08/13 00:00:00")) > "2024-01-08 00:00:00" > > The GIGO principle at its finest. :) However, I'd much prefer if the > function would check validity of the input and error out, rather than > returning a nonsensical result. But maybe that's another issue and > outside the scope of this bug report. I indeed think it's a separate issue.