Le 26 févr. 2010 à 19:47, Frank Niessink a écrit : > 2010/2/26 Jérôme Laheurte <[email protected]>: > > All beta-testers of v2 for the iPhone encounter a problem during sync; the > > log says > > > > File "taskcoachlib\iphone\protocol.pyo", line 697, in init > > AttributeError: 'Task' object has no attribute 'task' > > > > the offending lines are > > > > self.efforts = list([effort for effort in > > self.disp().window.taskFile.efforts().allItemsSorted() \ > > if effort.task() is None or not > > effort.task().isDeleted()]) > > > > which means that the effort list also contains Task instances ? Is that > > possible ? No matter what I try, I can't reproduce this myself... > > There should never be tasks in the taskFile.effort() container. I > think allItemsSorted may be the cause of this, it calls rootItems and > I'm afraid rootItems is somehow invoked on the taskList that the > effortList is decorating... The class hierarchy is quite complicated, > so I have trouble following the chain of invocations myself :-(
Finally found out... In the branch executed when the "Upload completed tasks" preference is enabled, I called allItemsSorted() on the effort list, but since it's not a Composite it doesn't have it. Then the __getattr__ of Observable seems to forward the lookup to the task list so I actually iterated over the task list! Since I always disable this setting, I couldn't reproduce it... Cheers Jérôme
