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


Groups > comp.lang.python > #77299

python-dateutil suggestiopn

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 <skip.montanaro@gmail.com>
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; '&gt;&gt;&gt;': 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 <skip@pobox.com>
To Python <python-list@python.org>
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 <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.13628.1409355350.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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

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


Thread

python-dateutil suggestiopn Skip Montanaro <skip@pobox.com> - 2014-08-29 18:35 -0500

csiph-web