[Vobject] Pickle and vObject
Jeffrey Harris
jeffrey at osafoundation.org
Tue Jun 3 15:13:37 CDT 2008
Hi Jonathan,
> I am working on an application using vObject, and its been a
> wonderful experience for the most part, but I am running into a
> problem. I am wanting to cache pre-parsed ICS files using a cache
> library that requires the objects to be cached be pickleable.
>
> It appears that vObject's representation of iCalendar files
> (Component) are not pickleable, for several reasons:
>
> 1. Recurring events keep around dateutil rrule objects, which
> apparently use thread locks, which are not pickleable.
>
> 2. Even if you fix item number 1, pickle complains that "generator
> objects are not pickleable."
>
> I noticed that non-recurring Component objects are, in fact, able to
> be pickled. It just appears to be a problem with recurring
> components.
>
> Is this something that vObject intends to support?
Supporting pickle would be great! It hadn't occurred to me as a
requirement, but it makes good sense.
One approach would be to pickle the non-native, parsed structure (pass
transform=False to readComponents).
I'm afraid I don't have time to work on this, but I'd be delighted to
take a patch/explain things if you'd like to have a go at tweaking
RecurringComponent to be pickle-able.
Sincerely,
Jeffrey
More information about the VObject
mailing list