#2782 HIGH Trial-3: cannot save previews to the datastore as binary data

Zarro Boogs per Child bugtracker at laptop.org
Tue Aug 14 08:13:56 EDT 2007


#2782: cannot save previews to the datastore as binary data
-----------------------+----------------------------------------------------
 Reporter:  tomeu      |       Owner:  bcsaller
     Type:  defect     |      Status:  new     
 Priority:  high       |   Milestone:  Trial-3 
Component:  datastore  |     Version:          
 Keywords:             |    Verified:  0       
-----------------------+----------------------------------------------------
 This code:

 {{{
 #!/usr/bin/env python
 import dbus

 bus = dbus.SessionBus()
 datastore = bus.get_object("org.laptop.sugar.DataStore",
                            "/org/laptop/sugar/DataStore")

 props = {'title': 'from dbus', 'author': "Benjamin"}
 uid = datastore.create(props, '/home/tomeu/sugar-
 jhbuild/source/datastore/tests/test.pdf')
 print "created uid", uid

 props['preview'] =
 dbus.ByteArray('\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00')
 datastore.update(uid, props, '/home/tomeu/sugar-
 jhbuild/source/datastore/tests/test.pdf')

 datastore.complete_indexing()
 print datastore.find(dict(query="dbus"))
 }}}

 gives this exception:

 {{{
 created uid 521af53b-724a-475a-823a-ca90371df26f
 Traceback (most recent call last):
   File "/home/tomeu/ds_test.py", line 13, in <module>
     datastore.update(uid, props, '/home/tomeu/sugar-
 jhbuild/source/datastore/tests/test.pdf')
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/dbus/proxies.py", line 136, in __call__
     **keywords)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/dbus/connection.py", line 603, in call_blocking
     message, timeout)
 dbus.exceptions.DBusException: org.freedesktop.DBus.Python.TypeError:
 Traceback (most recent call last):
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/dbus/service.py", line 664, in _message_cb
     retval = candidate_method(self, *args, **keywords)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/olpc/datastore/datastore.py", line 421, in update
     content.backingstore.update(uid, props, filelike)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/olpc/datastore/backingstore.py", line 389, in update
     self.indexmanager.index(props, filelike)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/olpc/datastore/xapianindex.py", line 333, in index
     self.enque(uid, vid, doc, operation, filestuff)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/olpc/datastore/xapianindex.py", line 153, in enque
     self.write_index.replace(doc)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/secore/indexerconnection.py", line 218, in replace
     document = self.process(document)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/secore/indexerconnection.py", line 162, in process
     actions.perform(result, field.value, context)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/secore/fieldactions.py", line 344, in perform
     info[2](self._fieldname, doc, value, context, **kwargs)
   File "/home/tomeu/sugar-jhbuild/build/lib/python2.5/site-
 packages/secore/fieldactions.py", line 70, in _act_index_freetext
     termgen.index_text(value, weight, '')
 TypeError: in method 'TermGenerator_index_text', argument 2 of type
 'std::string const &'
 }}}

-- 
Ticket URL: <https://dev.laptop.org/ticket/2782>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list