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

Fixes #111

Merged
merged 7 commits into from Jul 15, 2020
Merged

Fixes #111

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next
Port to Python 3 - fix TypeError
blob had been using str in python2.
str in python2 has been changed to bytes in python3.
Use encode to convert the python2 str to python3 bytes.

fixes error raised while testing collaboration:

Traceback (most recent call last):
  File "/usr/share/sugar/activities/Browse.activity/collabwrapper.py", line 688, in __notify_state_cb
    input_stream = self._get_input_stream()
  File "/usr/share/sugar/activities/Browse.activity/collabwrapper.py", line 736, in _get_input_stream
    return Gio.MemoryInputStream.new_from_data(self._blob, None)
TypeError: Item 0: Must be number, not str

Regression introduced in sugarlabs/collabwrapper@1395117
Also Reported by : Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in> in http://lists.sugarlabs.org/archive/sugar-devel/2020-June/058458.html
  • Loading branch information
srevinsaju authored and Saumya-Mishra9129 committed Jun 20, 2020
commit 13740569a1d99e13760e2d1f2e3a829844879ec3
@@ -729,7 +729,7 @@ def __init__(self, buddy, conn, blob, filename, description, mime):
_BaseOutgoingTransfer.__init__(
self, buddy, conn, filename, description, mime)

self._blob = blob
self._blob = blob.encode('utf-8')
self._create_channel(len(self._blob))

def _get_input_stream(self):