From fb2e3da0e5a08b7e7d81b89e773933c6b694ba77 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Date: Wed, 22 Apr 2015 15:42:39 +0200 Subject: [PATCH] Re: bug: notmuch cannot handle invalid Date fields --- 9f/035d47e42ab4e0f048a63d8dcb341a8fbfaeb5 | 124 ++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 9f/035d47e42ab4e0f048a63d8dcb341a8fbfaeb5 diff --git a/9f/035d47e42ab4e0f048a63d8dcb341a8fbfaeb5 b/9f/035d47e42ab4e0f048a63d8dcb341a8fbfaeb5 new file mode 100644 index 000000000..ef4be82fa --- /dev/null +++ b/9f/035d47e42ab4e0f048a63d8dcb341a8fbfaeb5 @@ -0,0 +1,124 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 6CF796DE17BF + for ; Wed, 22 Apr 2015 06:42:46 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.016 +X-Spam-Level: +X-Spam-Status: No, score=-0.016 tagged_above=-999 required=5 tests=[AWL=0.005, + RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, + RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id zZoZcPn1hnxl for ; + Wed, 22 Apr 2015 06:42:44 -0700 (PDT) +Received: from mout.web.de (mout.web.de [212.227.17.11]) + by arlo.cworth.org (Postfix) with ESMTPS id 141CA6DE1617 + for ; Wed, 22 Apr 2015 06:42:44 -0700 (PDT) +Received: from localhost ([46.5.19.64]) by smtp.web.de (mrweb102) with ESMTPSA + (Nemesis) id 0M6mPA-1ZW9sy1bU4-00wUfK for ; + Wed, 22 Apr 2015 15:42:40 +0200 +Content-Type: multipart/signed; protocol="application/pgp-signature"; + micalg="pgp-sha256"; boundary="===============7396538308649467340==" +MIME-Version: 1.0 +Content-Disposition: inline +From: Johannes Schauer +User-Agent: alot/0.3.6 +To: notmuch@notmuchmail.org +References: <20150422065630.6330.90536@hoothoot> + +In-Reply-To: +Message-ID: <20150422134239.6330.58670@hoothoot> +Subject: Re: bug: notmuch cannot handle invalid Date fields +Date: Wed, 22 Apr 2015 15:42:39 +0200 +X-Provags-ID: V03:K0:XFvPrMPO97gMKYKK+ZFaHjEU/NQN1bg0ohx++aFf+xhsw4arcrD + t6632LATaFVbpxo+XDi3NfzysmV1Zz/3kb6/B7cPtuX/x3v0tp4j+WsLfTDqxQj7tyv5ywP + QVn8MO3B1OGhJZiehPpNyh0YO9B7Ej3ffwgC6HzR80IhuV10eht+13lp1uPfqm8LyU3l8Ci + ynFelJN2HcnxJC9sdGqiQ== +X-UI-Out-Filterresults: notjunk:1; +X-Mailman-Approved-At: Wed, 22 Apr 2015 06:45:51 -0700 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 22 Apr 2015 13:42:46 -0000 + +--===============7396538308649467340== +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable + +Hi, + +Quoting Tomi Ollila (2015-04-22 15:37:15) +> What do you mean by that datetime cannot handle dates before 1900 ? +> = + +> : $ python +> : Python 2.7.6 (default, Mar 22 2014, 22:59:56) +> : ... +> : >>> datetime.datetime.strptime('1799-11', '%Y-%m') +> : datetime.datetime(1799, 11, 1, 0, 0) +> : >>> x=3Ddatetime.datetime.strptime('1799-11', '%Y-%m') +> : >>> x.isoformat() +> : '1799-11-01T00:00:00' + +from the docs: + +"The exact range of years for which strftime() works also varies across +platforms. Regardless of platform, years before 1900 cannot be used." + +or: + +$ python +Python 2.7.9 (default, Dec 11 2014, 08:58:12) = + +[GCC 4.9.2] on linux2 +Type "help", "copyright", "credits" or "license" for more information. +>>> import datetime +>>> x=3Ddatetime.datetime.strptime('1799-11', '%Y-%m') +>>> x.strftime("%P") +Traceback (most recent call last): + File "", line 1, in +ValueError: year=3D1799 is before 1900; the datetime strftime() methods req= +uire year >=3D 1900 + + +cheers, josch + +--===============7396538308649467340== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Description: signature +Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii" + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQIcBAABCAAGBQJVN6VPAAoJEPLLpcePvYPh94MQALSyLX0DA3jJN7mZnexkJhxS +5MlanN5d3nWsHvpL+BAGgfP1HKT6HdegwXh3rmJUKmNWkHq9VtZVVVN7Qkx8Ea06 +phjRlwRuR1Zl3HihYTbWZ3xCBOUM7QeVrT3APNJcixWmlJwNZq2q7QhCirqDh8cB +vfheYBkoflsf2FQu2/B9g0AK6zCXh7eYXDSrinUVUkMOsyIQBkiSBM+OhpyncOFJ +PCtNfof58TJKxXV5qoPxN02Emv6DPVFrULuKhrIlb2bq8LwGylerF65PGlz3MEJs +i9kQ/NaSo9Ge2sL6ITz9Q2CEmJJ3Ys4jLtLOsouQ9OY9gWDvIdHiy4FpD8om/v8u +XIjxIShHreAVQEB3olpooF70ZXmVh6tLVy4YJLQ+6hndN/bu2AYylbSWBl35J5Fm +JLD0I6JbY1x2mr86FM3UM0xIHgFz8tKK9dPC8L+xvjfeskY9A3xRYLVP2vip3+sk +/8b9Md1Lril9xGOBsqkzkhuV9duycUhpt6rhlQj0aqcx5LPWh8qPmn6aw/fb70lz +dGc1Z3FkTrPGE7puJvdh6njZrbY/0PrctsyH+hQyVv5qhcv3p6i0i6c9AqyV6/qm +8EQ+KzC+h9qUmxlwoZFQb5wie7Y+6g9Tko5dG19TOx72gFXLDPIcbsfJYuUgJBWW +BeH8p/npuV8dsSr1hbZW +=jzje +-----END PGP SIGNATURE----- + +--===============7396538308649467340==-- -- 2.26.2