Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shaansubbaiah opened this issue Jun 6, 2020 · 2 comments

Comments

@shaansubbaiah
Copy link
Member

shaansubbaiah commented Jun 6, 2020

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
Copy link
Member

Additional info : #922 (comment)

Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Jun 7, 2020
Fixes sugarlabs#923
Regression made in sugarlabs@aa18879#diff-685d653cc9490267e474dabc5c40b108R249

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Signed-off-by: Saumya Mishra <2017230@iiitdmj.ac.in>
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Jun 8, 2020
Fixes sugarlabs#923
Regression made in sugarlabs@aa18879#diff-685d653cc9490267e474dabc5c40b108R249

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Signed-off-by: Saumya Mishra <2017230@iiitdmj.ac.in>
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Jun 9, 2020
Fixes sugarlabs#923
Regression made in sugarlabs@aa18879#diff-685d653cc9490267e474dabc5c40b108R249

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Signed-off-by: Saumya Mishra <2017230@iiitdmj.ac.in>
@quozl
Copy link
Contributor

quozl commented Jun 15, 2020

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.

@quozl quozl mentioned this issue Jun 15, 2020
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Jun 16, 2020
Fixes sugarlabs#923
Regression made in aa18879#diff-685d653cc9490267e474dabc5c40b108R249
get_bundle_id always returns a str, encode it
md5 hash function accepts sequence of bytes

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Jun 20, 2020
Fixes sugarlabs#923
Regression made in aa18879#diff-685d653cc9490267e474dabc5c40b108R249
get_bundle_id always returns a str, encode it
md5 hash function accepts sequence of bytes

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Aug 15, 2020
t 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.

Fixes sugarlabs#923
Regression made in aa18879#diff-685d653cc9490267e474dabc5c40b108R249
get_bundle_id always returns a str, encode it
md5 hash function accepts sequence of bytes

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
Saumya-Mishra9129 added a commit to Saumya-Mishra9129/sugar that referenced this issue Aug 16, 2020
t 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.

Fixes sugarlabs#923
Regression made in aa18879#diff-685d653cc9490267e474dabc5c40b108R249
get_bundle_id always returns a str, encode it
md5 hash function accepts sequence of bytes

Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in>
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'
@quozl quozl closed this as completed in 118fe73 Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants