Fix utf encoding error via six

This commit is contained in:
Aniket21mathur 2019-07-13 19:06:49 +05:30 committed by James Cameron
parent 490a602367
commit e4725ad196

View File

@ -917,7 +917,10 @@ class Activity(Window, Gtk.Container):
buddies = {} buddies = {}
for buddy in self.shared_activity.get_joined_buddies(): for buddy in self.shared_activity.get_joined_buddies():
if not buddy.props.owner: if not buddy.props.owner:
if six.PY2:
buddy_id = sha1(buddy.props.key).hexdigest() buddy_id = sha1(buddy.props.key).hexdigest()
else:
buddy_id = sha1((buddy.props.key).encode('utf-8')).hexdigest()
buddies[buddy_id] = [buddy.props.nick, buddy.props.color] buddies[buddy_id] = [buddy.props.nick, buddy.props.color]
return buddies return buddies
else: else: