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


Groups > comp.lang.python > #77301 > unrolled thread

Re: python-dateutil suggestiopn

Started byChris Angelico <rosuav@gmail.com>
First post2014-08-30 09:40 +1000
Last post2014-08-30 09:40 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#77301 — Re: python-dateutil suggestiopn

FromChris Angelico <rosuav@gmail.com>
Date2014-08-30 09:40 +1000
SubjectRe: python-dateutil suggestiopn
Message-ID<mailman.13630.1409355635.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web