Thanks for the reply Rob - yup it's a string all right, but the only
time *I* pass anything to rfc3399 is when I pass it a datetime.datetime
object.

It seems that the routine feedgenerator.writeString is sending rfc3399
a string rather than a datetime.datetime object, which it gets from the
write method of Atom1Feed - the relevant bit is here...

        handler.addQuickElement(u"updated",
rfc3339_date(self.latest_post_date()).decode('ascii'))

Which leads to this (with my debug prints);

    def latest_post_date(self):
        """
        Returns the latest item's pubdate. If none of them have a
pubdate,
        this returns the current date/time.
        """
        updates = [i['pubdate'] for i in self.items if i['pubdate'] is
not None]
        print "UPDATES", updates
        if len(updates) > 0:
            updates.sort()
            print "updates:", type(updates[-1])
            return updates[-1]
        else:
            print "datetime.datetime.now()", datetime.datetime.now()
            return datetime.datetime.now()

What happens now?

Well, this;

UPDATES ['2005-11-25T11:51:01Z']
updates: <type 'str'>

Which leads to the blow-up.

I would have thought that other people would have seen this which is
why I re-iterate "what stupid thing am I doing here?" ;)

many thanks
Tone

Reply via email to