Ticket #2585 (new defect)

Opened 2 years ago

Last modified 2 years ago

save fails with None buddy reference

Reported by: walter Owned by: erikos
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
Component: sugar-toolkit Version: 0.90.x
Severity: Unspecified Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

I joined a seeming phantom shared activity and got this error when quitting:

1297121383.895540 ERROR root: Error saving activity object to datastore
Traceback (most recent call last):

File "/usr/lib/python2.7/site-packages/sugar/activity/activity.py", line 823, in _prepare_close

self.save()

File "/usr/lib/python2.7/site-packages/sugar/activity/activity.py", line 642, in save

buddies_dict = self._get_buddies()

File "/usr/lib/python2.7/site-packages/sugar/activity/activity.py", line 617, in _get_buddies

buddy_id = sha1(buddy.props.key).hexdigest()

TypeError: must be string or buffer, not None

We should catch the None buddy instance.

Change History

Changed 2 years ago by walter

  • owner set to erikos
  • component changed from sugar to sugar-toolkit

Changed 2 years ago by walter

I confirmed that there was a buddy.props.key with value None.

Adding a simple test for None seems to remedy the problem but doesn't necessarily address the root cause:

if buddy.props.key is not None:

buddy_id = sha1(buddy.props.key).hexdigest()
buddies[buddy_id] = [buddy.props.nick, buddy.props.color]

Note: See TracTickets for help on using tickets.