Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'discard': 0.07; 'problem:': 0.07; 'pypi': 0.07; 'skip:" 60': 0.07; 'suppose': 0.07; 'string': 0.09; 'suffix': 0.09; '**kwargs)': 0.16; '23,': 0.16; '42,': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'gmail.': 0.16; 'iterable': 0.16; 'typeerror:': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'sender:addr:gmail.com': 0.17; '>>>': 0.22; 'aug': 0.22; '>>>': 0.24; 'parse': 0.24; 'skip': 0.24; 'decide': 0.24; 'header': 0.24; "i've": 0.25; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'easier': 0.31; '"",': 0.31; 'author,': 0.31; 'occurs': 0.31; 'skip:& 70': 0.31; 'file': 0.32; 'skip:- 30': 0.32; '(most': 0.33; 'actively': 0.33; 'fri,': 0.33; 'skip:d 20': 0.34; 'could': 0.34; 'info': 0.35; 'but': 0.35; 'received:google.com': 0.35; '8bit%:9': 0.36; 'date.': 0.36; 'object,': 0.36; 'next': 0.36; 'two': 0.37; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'easy': 0.60; 'most': 0.60; 'address': 0.63; 'him,': 0.64; 'different': 0.65; 'low': 0.83; 'gulf': 0.84; 'tossing': 0.84; 'worthwhile.': 0.84; 'hopes': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=d1+lMJu4Np0DRSZ6L9I657KTBvIg20K2Nxrz92LxGBk=; b=Ma0HYQCUQCBOyfwlmaMjXyqeB04Y+BTAevCRitP6WzgolkFDJ1BVlaC2SW88AuO7if 3VHGrX8uBpqEHhL4OeLyQHln/eKc3iXRsAHYjMTSR802aBOy+DNmj+Cd3WNpNDc4FHV4 Vs2FqrAPkqW+MCQNSdfztcmPfJCMOPYvJsclY48naGX+davJPAaV+1hqOccX43MKa/yg vOAYcBMc+D8gaCB1+uTQzqsy42krDjRuQljKypPwtkQCa6NEpJu8SwZzIhlTjsOKfRup lhVj2FdyYeGnaPFkluJtr8Y283G67MKbnhaBSy5nSiBqwdaDOR0HwKtezaqALSZXjUnw NBMA== MIME-Version: 1.0 X-Received: by 10.50.164.202 with SMTP id ys10mr7742721igb.6.1409355341301; Fri, 29 Aug 2014 16:35:41 -0700 (PDT) Sender: skip.montanaro@gmail.com Date: Fri, 29 Aug 2014 18:35:41 -0500 X-Google-Sender-Auth: YrWOdUGtPve13ks95MEY65X_Y-g Subject: python-dateutil suggestiopn From: Skip Montanaro To: Python Content-Type: multipart/alternative; boundary=089e014949067b27f80501cd1cb9 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 84 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409355350 news.xs4all.nl 2859 [2001:888:2000:d::a6]:36106 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77299 --089e014949067b27f80501cd1cb9 Content-Type: text/plain; charset=UTF-8 It doesn't look like Gustavo Niemeyer is actively working on python-dateutil. Tomi Pievilaeinen is listed on PyPI as the author, but I have no email address for him, so I'm tossing this message in a bottle out into the Gulf Stream in hopes that Gustavo or Tomi notice it. 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) Discarding the extra timezone info in the "(GMT-07:00)" suffix makes the string parseable: >>> dateutil.parser.parse('Sat, 23 Aug 2014 16:42:08 -0700 (GMT-07:00)') Traceback (most recent call last): File "", line 1, in File "/Users/skip/.local/lib/python2.7/site-packages/dateutil/parser.py", line 748, in parse return DEFAULTPARSER.parse(timestr, **kwargs) File "/Users/skip/.local/lib/python2.7/site-packages/dateutil/parser.py", line 310, in parse res, skipped_tokens = self._parse(timestr, **kwargs) TypeError: 'NoneType' object is not iterable >>> dateutil.parser.parse('Sat, 23 Aug 2014 16:42:08 -0700') datetime.datetime(2014, 8, 23, 16, 42, 8, tzinfo=tzoffset(None, -25200)) I suppose I could work around the problem, but it occurs so rarely, it's just easier to discard that particular date. This would seem to be low priority for Tomi and Gustavo, but thought that if it was an easy change it might be worthwhile. Skip --089e014949067b27f80501cd1cb9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It doesn't look like Gustavo Niemeyer is actively work= ing on python-dateutil.=C2=A0Tomi Pievilaeinen is listed on PyPI as the aut= hor, but I have no email address for him, so I'm tossing this message i= n a bottle out into the Gulf Stream in hopes that Gustavo or Tomi notice it= .

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 sta= rt up on the next run.

Every once in awhile, I encountered a Date header I cou= ldn't parse. The couple I've seen so far have the same problem: two= different spellings of the timezone offset.

=C2= =A0 =C2=A0=C2=A0Sat, 23 Aug 2014 16:42:08 -0700 (GMT-07:00)
=C2=A0 =C2=A0=C2=A0Fri, 22 Aug 2014 18:14:46 -0700 (GMT-07:00)

Discarding the extra timezone info in the "(GMT-07:0= 0)" suffix makes the string parseable:

>&g= t;> dateutil.parser.parse('Sat, 23 Aug 2014 16:42:08 -0700 (GMT-07:0= 0)')
Traceback (most recent call last):
=C2=A0 File "<stdin>= ;", line 1, in <module>
=C2=A0 File "/Users/skip/= .local/lib/python2.7/site-packages/dateutil/parser.py", line 748, in p= arse
=C2=A0 =C2=A0 return DEFAULTPARSER.parse(timestr, **kwargs)
= =C2=A0 File "/Users/skip/.local/lib/python2.7/site-packages/dateutil/p= arser.py", line 310, in parse
=C2=A0 =C2=A0 res, skipped_tok= ens =3D self._parse(timestr, **kwargs)
TypeError: 'NoneType' object is not iterable
>>= ;> dateutil.parser.parse('Sat, 23 Aug 2014 16:42:08 -0700')datetime.datetime(2014, 8, 23, 16, 42, 8, tzinfo=3Dtzoffset(None, -25200))=

I suppose I could work around the problem, but it occur= s so rarely, it's just easier to discard that particular date. This wou= ld seem to be low priority for Tomi and Gustavo, but thought that if it was= an easy change it might be worthwhile.

Skip

--089e014949067b27f80501cd1cb9--