max age option exception

1 Aufruf
Direkt zur ersten ungelesenen Nachricht

Bryan Clark

ungelesen,
17.07.2010, 19:11:4317.07.10
an raindr...@googlegroups.com
Hey -

I got the following errors when using the max-age option.

ERROR:raindrop.proto.imap:unexpected exception
Traceback (most recent call last):
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/conductor.py", line 267, in apply_with_retry
return func(*args, **kw)
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/proto/imap/__init__.py", line 314, in _doit
func(*args)
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/proto/imap/sync.py", line 254, in _update_one_folder
to_fetch = get_to_fetch()
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/model/storage.py", line 170, in handler
return func(*args+(storage,), **kw)
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/proto/imap/sync.py", line 230, in get_to_fetch
if self.should_fetch_message(message):
File "/Users/clarkbw/moz/raindrop-reboot/raindrop/raindrop/proto/imap/sync.py", line 443, in should_fetch_message
if msg.date< datetime.datetime.utcnow() - datetime.timedelta(seconds=self.options.max_age):
TypeError: can't compare offset-naive and offset-aware datetimes


The attached patch uses the existing UTC offset object in datetime.now()
which is also used in the imap object creation. If this looks like the
right fix I can go ahead and push it.

Cheers,
~ Bryan

offset-aware.patch

Mark Hammond

ungelesen,
18.07.2010, 20:41:5818.07.10
an raindr...@googlegroups.com, Bryan Clark
On 18/07/2010 9:11 AM, Bryan Clark wrote:
> The attached patch uses the existing UTC offset object in datetime.now()
> which is also used in the imap object creation. If this looks like the
> right fix I can go ahead and push it.

Looks good to me!

Thanks,

Mark

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten