sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
252 stars 240 forks source link

Sugar 117-3 on Debian - AttributeError: 'str' object has no attribute 'decode' #923

Closed shaansubbaiah closed 3 years ago

shaansubbaiah commented 4 years ago
1591278095.943871 ERROR dbus.proxies: Introspect error on :1.28:/org/laptop/Activity/376730b6f93a8aa9b2929c28e423b45b73f2b515: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1591278095.944801 ERROR root: set_active() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.28 was not provided by any .service files
1591278100.365706 ERROR dbus.proxies: Introspect error on :1.30:/org/laptop/Activity/376730b6f93a8aa9b2929c28e423b45b73f2b515: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1591278100.366105 ERROR root: set_active() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.30 was not provided by any .service files
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/jarabe/desktop/viewcontainer.py", line 69, in do_size_allocate
    self._layout.allocate_children(allocation, self._children)
  File "/usr/lib/python3/dist-packages/jarabe/desktop/favoriteslayout.py", line 250, in allocate_children
    name_hash = hashlib.md5(child.get_bundle_id().decode())
AttributeError: 'str' object has no attribute 'decode'

Not sure how exactly to reproduce, found in shell.log on Debian Buster (10.4) running Sugar 117-3

@chimosky suggested that it may be regression from porting to Python 3.

srevinsaju commented 4 years ago

Additional info : https://github.com/sugarlabs/sugar/pull/922#issuecomment-639882809

quozl commented 4 years ago

It is reproduced by choosing Favorites View - Random View from the toolbar in the Home View.

Impact is that the favourites view disappears and is empty.

It is caused by mistake of using decode on a str instead of encode, and not testing.

If the decode is removed, one sees Type:Error: Unicode-objects must be encoded before hashing.

If an encode is substituted, the feature works without error.