Problems with unicode

Bug #488327 reported by Siegfried Gevatter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Critical
Unassigned

Bug Description

[rainct, zeitgeist-0.3]$ rm /home/rainct/.local/share/zeitgeist/activity.sqlite*[rainct, zeitgeist-0.3]$ ./zeitgeist-daemon DEBUG:zeitgeist.engine:Creating engine 'resonance'
INFO:zeitgeist.engine:Creating database: /home/rainct/.local/share/zeitgeist/activity.sqlite
DEBUG:root:Checking for another running instance...
DEBUG:root:No running instances found.
INFO:root:S'està iniciant el servei Zeitgeist...
DEBUG:root:S'està actualitzant la base de dades amb noves activitats: Recently Used Documents
ERROR:root:Error logging item from "Recently Used Documents": org.freedesktop.DBus.Python.UnicodeEncodeError
Traceback (most recent call last):
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../zeitgeist-datahub", line 126, in _insert_events
    self._client.InsertEvents(events)
  File "/usr/lib/pymodules/python2.5/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 622, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/remote.py", line 134, in InsertEvents
    return _engine.insert_events(events)
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/resonance_engine.py", line 442, in insert_events
    return map (self.insert_event, events)
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/resonance_engine.py", line 474, in insert_event
    stext_id = _text.lookup_or_create(subj.text).id if subj.text else None
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/dbutils.py", line 95, in lookup_or_create
    ent = self.lookup(value)
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/dbutils.py", line 79, in lookup
    row = self._cursor.execute("""SELECT id FROM %s WHERE value=?""" % self.get_name(), (value,)).fetchone()
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/resonance_engine.py", line 70, in execute
    parameters = [self.fix_unicode(p) for p in parameters]
  File "/home/rainct/Desenvolupament/Python/zeitgeist-project/zeitgeist-0.3/zeitgeist/../_zeitgeist/engine/resonance_engine.py", line 65, in fix_unicode
    obj = obj.decode("UTF-8")
  File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 1: ordinal not in range(128)

Related branches

Changed in zeitgeist:
importance: Undecided → Critical
milestone: none → 0.3.0
status: New → Confirmed
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

I am pretty sure that the reason for this bug is that we would at times try to decode an already decoded unicode string within our magical UnicodeCursor class. I fixed this in lp:zeitgeist r1164.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

I am wondering how I can link to a particular revision inside a branch in launchpad bugs? Testing:
lp:zeitgeist:1164
1164:lp:zeitgeist

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Fixed in r1166. We had another double decode of a unicode string in querymancer.

Changed in zeitgeist:
status: Confirmed → Fix Released
Revision history for this message
Siegfried Gevatter (rainct) wrote : Re: [Bug 488327] Re: Problems with unicode

Works! You rock :)

--
Siegfried-Angel Gevatter Pujals (RainCT)
Free Software Developer 363DEAE3

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.