[Bugs] #4411 sugar-datastore NORM: sugar3.datastore.datastore.get raises an incorrect exception

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Tue Feb 5 09:09:38 EST 2013


#4411: sugar3.datastore.datastore.get raises an incorrect exception
--------------------------------+-------------------------------------------
    Reporter:  humitos          |          Owner:  sascha_silbe
        Type:  defect           |         Status:  new         
    Priority:  Normal           |      Milestone:  1.0         
   Component:  sugar-datastore  |        Version:  Unspecified 
    Severity:  Unspecified      |       Keywords:              
Distribution:  Unspecified      |   Status_field:  Unconfirmed 
--------------------------------+-------------------------------------------
 I found that {{{sugar3.datastore.datastore.get}}} raises an invalid
 exception when the {{{object_id}}} is not found.

 For example, I created a playlist with Jukebox that includes some files
 from a Pen Drive, some others from the Journal and another one from the
 Documents folder.

 Then, I closed Jukebox and copied that Journal's entry to the Pen Drive.
 After that, I opened that Journal's entry into another XO (with the same
 version of Jukebox -from git-) and I got an exception similar to this one.

 {{{
 >>> from sugar3.datastore import datastore
 >>> datastore.get('2213-12345-1252-3456-3432-3466')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.py",
 line 297, in get
     metadata = _get_data_store().get_properties(object_id,
 byte_arrays=True)
   File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 70, in
 __call__
     return self._proxy_method(*args, **keywords)
   File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 145, in
 __call__
     **keywords)
   File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 651, in
 call_blocking
     message, timeout)
 dbus.exceptions.DBusException: org.freedesktop.DBus.Python.IOError:
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/dbus/service.py", line 707, in
 _message_cb
     retval = candidate_method(self, *args, **keywords)
   File "/usr/lib/python2.7/site-packages/carquinyol/datastore.py", line
 467, in get_properties
     metadata = self._metadata_store.retrieve(uid)
   File "/usr/lib/python2.7/site-packages/carquinyol/metadatastore.py",
 line 60, in retrieve
     return metadatareader.retrieve(metadata_path, properties)
 IOError: Couldn't open metadata directory
 /home/olpc/.sugar/default/datastore/22/2213-12345-1252-3456-3432-3466/metadata

 >>>
 }}}

 I think it's invalid / incorrect because it doesn't say anything about
 that the entry was not found.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4411>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list