max age option exception

1 view
Skip to first unread message

Bryan Clark

unread,
Jul 17, 2010, 7:11:43 PM7/17/10
to 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

unread,
Jul 18, 2010, 8:41:58 PM7/18/10
to 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

Reply all
Reply to author
Forward
0 new messages