[Vobject] copy.deepcopy on a calendar

Jeffrey Harris jeffrey at osafoundation.org
Wed Feb 22 17:06:19 CST 2006


Hi Cyrus,

> I believe the issue is caused by the self._cache_lock in class rrulebase
> in rrule.py in dateutil. However, I'm not sure if it can be resolved there.

Yup, that seems plausible.

> Some possible workarounds:
> 
> 1) Do 'transformFromNative', then do deepcopy, then transform back each
> time a duplicate component is needed.
> 
> 2) Fix dateutil.

This seems like a good plan in the long run.  I think Gustavo may be
busy at the moment (I've sent him a few patches and I don't think he's
done anything with them yet), but I imagine he'll come up for air at
some point.

> 3) Add a 'duplicate' method in vobject that does not use deepcopy.
> 
> I ended up doing the later and that works well. However I'm not sure
> whether others would want this. Attached is a patch to base.py that does
> this - please comment.

I think that's a useful method to add, particularly if you add a comment
explaining the problem with deepcopy.

Sincerely,
Jeffrey


More information about the VObject mailing list