Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77301

Re: python-dateutil suggestiopn

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'problem:': 0.07; 'rfc': 0.09; 'cc:addr:python-list': 0.11; '822': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gmail.': 0.16; 'parentheses': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'parse': 0.24; 'skip': 0.24; 'decide': 0.24; 'header': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'fri,': 0.33; 'comment': 0.34; 'skip:d 20': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'date.': 0.36; 'object,': 0.36; 'next': 0.36; 'two': 0.37; 'anything': 0.39; 'recent': 0.39; "couldn't": 0.39; 'remove': 0.60; 'most': 0.60; "you're": 0.61; 'different': 0.65; '30,': 0.65; 'adorn': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=bt9JxlYtqV7PnbfrbgRDxz1dQ58LmTbLjQRYcMCnKHM=; b=acpMwyxrxo14eWWeFR7/Fejb3SwoT9TH/cHbW8H0OSi9eRu8JEfbFbatgaCPGkcKv/ Jy1WDTBh9BXjrGg5jdtO4aaKuHWuh67RdD0PRz32H7Q+mscCtKHKLlS2wXdLfdhE114P x1qSbslLrtOausYlhNhWfjN3jPdCAkg5omSES8Q5l7ElMDyLUV/7DrZIL1ICNkl0FPlX CbGyb5CAV3ODTfNVfCNmbxwnHkthTPC5X9ZGikGDmrK82xzVJFA3c3wQro2oq/OMAezu SpRXystOzxRN7g/NJjkU5HkuHXsxz/OSSjTlPQdD8osAnl1gt0YJrqTqdc3isaIzP4oS 8t3g==
MIME-Version 1.0
X-Received by 10.50.80.76 with SMTP id p12mr7852697igx.34.1409355627165; Fri, 29 Aug 2014 16:40:27 -0700 (PDT)
In-Reply-To <CANc-5UzChuZMX7q5JR42C6cwiTFAnR1jBFL79GDV-kE=e85otw@mail.gmail.com>
References <CANc-5UzChuZMX7q5JR42C6cwiTFAnR1jBFL79GDV-kE=e85otw@mail.gmail.com>
Date Sat, 30 Aug 2014 09:40:27 +1000
Subject Re: python-dateutil suggestiopn
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13630.1409355635.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409355635 news.xs4all.nl 2844 [2001:888:2000:d::a6]:45063
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77301

Show key headers only | View raw


On Sat, Aug 30, 2014 at 9:35 AM, Skip Montanaro <skip@pobox.com> wrote:
> I'm using imaplib to download and process messages from Gmail. I use
> dateutil.parser.parse to parse the Date header into a datetime object, then
> use the most recent date I've seen to decide where to start up on the next
> run.
>
> Every once in awhile, I encountered a Date header I couldn't parse. The
> couple I've seen so far have the same problem: two different spellings of
> the timezone offset.
>
>     Sat, 23 Aug 2014 16:42:08 -0700 (GMT-07:00)
>     Fri, 22 Aug 2014 18:14:46 -0700 (GMT-07:00)

That's an RFC 822 comment attached to the Date header. I've no idea
why you're seeing that - which client feels the need to adorn the date
like that??? - but I think it would be appropriate to remove anything
in parentheses before attempting to parse the date.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python-dateutil suggestiopn Chris Angelico <rosuav@gmail.com> - 2014-08-30 09:40 +1000

csiph-web