[Sugar-devel] Issues loading datastore objects
Daniel Narvaez
dwnarvaez at gmail.com
Tue Sep 10 11:56:27 EDT 2013
That fails with the following trace here, which is 2 in my list of issues.
File
"/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/jarabe/apisocket.py",
line 163, in get_properties_reply_handler
self._client.send_result(request, [properties])
File
"/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/jarabe/apisocket.py",
line 258, in send_result
self._session.send_message(json.dumps(response))
File "/usr/lib64/python2.7/json/__init__.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0:
invalid start byte
The properties looks like this
dbus.Dictionary({dbus.String(u'activity'):
dbus.ByteArray('org.laptop.Edit', variant_level=1),
dbus.String(u'activity_id'):
dbus.ByteArray('5f4ce82bb1f20fea6acb7deddd803293ee894af5',
variant_level=1), dbus.String(u'org.laptop.Edit.cloudstring'):
dbus.ByteArray("(dp1\nS'shared_buffer'\np2\n(lp3\n(I-1\nI-1\nI0\nI0\nS''\ntp4\na(I8793677715175311230\nI-1\nI0\nI0\nS'H'\ntp5\na(I8374422773697907387\nI8793677715175311230\nI0\nI1\nS'e'\ntp6\na(I980346379479397073\nI8374422773697907387\nI0\nI1\nS'l'\ntp7\na(I1695930828609738611\nI980346379479397073\nI0\nI1\nS'l'\ntp8\na(I4740272525434690190\nI1695930828609738611\nI0\nI1\nS'o'\ntp9\nas.",
variant_level=1), dbus.String(u'title_set_by_user'): dbus.ByteArray('0',
variant_level=1), dbus.String(u'uid'):
dbus.String(u'16f57ff6-2dae-4ab1-aa06-4d71684ed2d6', variant_level=1),
dbus.String(u'title'): dbus.ByteArray('Edit Activity', variant_level=1),
dbus.String(u'timestamp'): dbus.ByteArray('1378823663', variant_level=1),
dbus.String(u'org.laptop.Edit.cloudtimestamp'): dbus.ByteArray('5.71',
variant_level=1), dbus.String(u'creation_time'):
dbus.ByteArray('1378823663', variant_level=1), dbus.String(u'share-scope'):
dbus.ByteArray('private', variant_level=1), dbus.String(u'keep'):
dbus.ByteArray('0', variant_level=1), dbus.String(u'icon-color'):
dbus.ByteArray('#008009,#FF2B34', variant_level=1),
dbus.String(u'launch-times'): dbus.ByteArray('1378823658',
variant_level=1), dbus.String(u'filesize'): dbus.String(u'5',
variant_level=1), dbus.String(u'checksum'):
dbus.ByteArray('8b1a9953c4611296a827abf8c47804d7', variant_level=1),
dbus.String(u'org.laptop.Edit.contents'): dbus.ByteArray('Hello',
variant_level=1), dbus.String(u'preview'):
dbus.ByteArray('\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xd8\x00\x00\x00\xa2\x08\x06\x00\x00\x00#\x99\x03J\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x01\xadIDATx\x9c\xed\xd3A\r\x83\x00\x10\x00\xc1k\x85"\x01/X@\x0cO\x14\x91P\r}lH\xc8\x8c\x82\xfd\xec\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc03>\xdb\xb6\xdd\xeb\xba\xce\xcc\xcc\xbe\xef\xb3,\xcb\xc3I\xf0\x1e\xdf\xe38ff\xe6\xba\xae\x99\x999\xcf\xf3\xc9\x1ex\x95\xcf}\xdf\xf7\xd3\x11\xf0V\xdf\xa7\x03\xe0\xcd\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06!\x83A\xc8`\x102\x18\x84\x0c\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xf8\x01\xe1&\x13\x89*\xf6\xc8\xe4\x00\x00\x00\x00IEND\xaeB`\x82',
variant_level=1), dbus.String(u'mtime'):
dbus.ByteArray('2013-09-10T14:34:23.986468', variant_level=1),
dbus.String(u'mime_type'): dbus.ByteArray('text/plain', variant_level=1)},
signature=dbus.Signature('sv'))
So we have both normal strings and binary data wrapped in a dbus.Array and
no way to know which is which.
I tend to think we should base64 encode all the values (we could skip
dbus.String but I'm not too sure we would save bytes, because then for each
value we need to tell which type it is). Then on the js side we can
window.atob() all the values. To be honest I don't understand exactly what
atob returns but whatever it is, it can be used as a string and it can
transformed into a byte array (https://gist.github.com/borismus/1032746),
so we should be fine.
On 10 September 2013 16:20, Suraj K S <suraj.gillespie at gmail.com> wrote:
> Ah. That version wasn't working on my comp either.
>
> Try this http://git.sugarlabs.org/~flavio/edit-activity/editgtk3
>
>
> On 10 September 2013 19:47, Daniel Narvaez <dwnarvaez at gmail.com> wrote:
>
>> This one
>>
>> http://activities.sugarlabs.org/en-US/sugar/addon/4349
>>
>>
>> On 10 September 2013 16:16, Daniel Narvaez <dwnarvaez at gmail.com> wrote:
>>
>>> Which environment are you using for testing? I tried in sugar-build,
>>> downloaded Edit from activities.sugarlabs.org and it wouldn't start.
>>> Maybe just a dependency issue, I didn't investigate, but I want to be sure
>>> we are using the same environment...
>>>
>>
>>
>>
>> --
>> Daniel Narvaez
>>
>
>
--
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130910/21a0f8b3/attachment-0001.html>
More information about the Sugar-devel
mailing list