Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Coerce BaseBuddyModel.props.key to str
In Group View when a friend is made a traceback occurs.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/jarabe/view/buddymenu.py", line 205, in _make_friend_cb
friends.get_model().makefriend(self._buddy)
File "/usr/lib/python3/dist-packages/jarabe/model/friends.py", line 130, in make_friend
self.save()
File "/usr/lib/python3/dist-packages,jarabe/model/friends.py", line 160, in save
cp.add_section(section)
File "/usr/lib/python3.8/configparser.py", line 1207, in add_section
self._validate_value_types(section=section)
File "/usr/lib/python3.8/configparser.py", line 1180, in _validate_value_types
raise TypeError("section names must be strings")
TypeError: section names must be strings
In Group View when a friend is removed a traceback occurs.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/jarabe/desktop/groupbox.py", line 67, in _friend_removed_cb
icon = self._friend[key]
KeyError: "b'AAAA0...'"
Regression introduced aa18879; a
BaseBuddyModel.props.key is coerced to bytes before being sent to
Telepathy.
Telepathy API for connection interface buddy info key uses a
dbus.ByteArray.
A dbus.ByteArray is now a subclass of bytes, where in Python 2 it is a
subclass of str.
https://dbus.freedesktop.org/doc/dbus-python/PY3PORT.html
When the buddy key is set from bytes, convert to str in utf-8 encoding.
When the buddy key is sent to Telepathy, convert to bytes.
Signed-off-by: James Cameron <quozl@laptop.org>- Loading branch information