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


Groups > comp.lang.python > #77302

Re: python-dateutil suggestiopn

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'discard': 0.07; 'problem:': 0.07; 'pypi': 0.07; 'skip:" 60': 0.07; 'suppose': 0.07; 'string': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suffix': 0.09; 'suggest': 0.14; 'language.': 0.14; '**kwargs)': 0.16; '23,': 0.16; '42,': 0.16; 'gmail.': 0.16; 'iterable': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'typeerror:': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'trying': 0.19; '>>>': 0.22; 'aug': 0.22; 'header:User-Agent:1': 0.23; 'parse': 0.24; 'skip': 0.24; 'decide': 0.24; 'header': 0.24; "i've": 0.25; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; "i'm": 0.30; 'easier': 0.31; '"",': 0.31; 'author,': 0.31; 'occurs': 0.31; 'file': 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; 'date.': 0.36; 'object,': 0.36; 'next': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'recent': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'easy': 0.60; 'most': 0.60; 'numbers': 0.61; 'reach': 0.63; 'address': 0.63; 'our': 0.64; 'him,': 0.64; 'different': 0.65; 'north': 0.65; 'charset:windows-1252': 0.65; 'low': 0.83; 'audience,': 0.84; 'gulf': 0.84; 'received:2': 0.84; 'tossing': 0.84; 'worthwhile.': 0.84; 'hopes': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: python-dateutil suggestiopn
Date Sat, 30 Aug 2014 00:43:36 +0100
References <CANc-5UzChuZMX7q5JR42C6cwiTFAnR1jBFL79GDV-kE=e85otw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-2-98-194-65.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0
In-Reply-To <CANc-5UzChuZMX7q5JR42C6cwiTFAnR1jBFL79GDV-kE=e85otw@mail.gmail.com>
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.13631.1409355838.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409355838 news.xs4all.nl 2944 [2001:888:2000:d::a6]:48450
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77302

Show key headers only | View raw


On 30/08/2014 00:35, Skip Montanaro wrote:
> 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 "<stdin>", line 1, in <module>
>    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
>

The Gulf Stream is not likely to reach a large enough audience, I 
suggest you expand the numbers by trying the North Atlantic Drift.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Thread

Re: python-dateutil suggestiopn Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-30 00:43 +0100

csiph-web