Opened 11 years ago

Closed 10 years ago

#4411 closed defect (wontfix)

sugar3.datastore.datastore.get raises an incorrect exception

Reported by: humitos Owned by: sascha_silbe
Priority: Normal Milestone: Unspecified
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords:
Cc: godiard, erikos, manuq, humitos Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

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.

Change History (3)

comment:1 Changed 11 years ago by dnarvaez

  • Component changed from sugar-datastore to Sugar

comment:2 Changed 11 years ago by dnarvaez

  • Milestone changed from 1.0 to Unspecified

comment:3 Changed 10 years ago by dnarvaez

  • Resolution set to wontfix
  • Status changed from new to closed

The error message doesn't seem that bad to me. I wouldn't bother fixing this... But patches accepted.

Note: See TracTickets for help on using tickets.