Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77301
| References | <CANc-5UzChuZMX7q5JR42C6cwiTFAnR1jBFL79GDV-kE=e85otw@mail.gmail.com> |
|---|---|
| Date | 2014-08-30 09:40 +1000 |
| Subject | Re: python-dateutil suggestiopn |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13630.1409355635.18130.python-list@python.org> (permalink) |
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
Re: python-dateutil suggestiopn Chris Angelico <rosuav@gmail.com> - 2014-08-30 09:40 +1000
csiph-web