birthday import error

Bug #980032 reported by codemonkey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dexter - Old
New
Undecided
Unassigned

Bug Description

Dexter crashed while importing a vcard file (originally created by kaddressbook):

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/site-packages/dexter/backend/utilities.py", line 49, in run
    import_from_vcard_string(vstring, self.q)
  File "/usr/lib/python2.7/site-packages/dexter/backend/utilities.py", line 135, in import_from_vcard_string
    first_name = card.n.value.given.strip() #
AttributeError: 'list' object has no attribute 'strip'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dexter/app.py", line 657, in import_timeout
    item[8], item[9], item[10])
  File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.ValueError: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/bin/dexter-server", line 104, in CreateContact
    phones, addresses, imnicks, notes, self.store)
  File "/usr/lib/python2.7/site-packages/dexter/backend/serverutils.py", line 73, in create_new_contact
    int(birthdaylist[2]))
ValueError: invalid literal for int() with base 10: '01T00:00:00Z'

This is a date format I've seen before. I don't know whether it is a valid date format for vcards but it's probably a good idea in any case to check the data to see if it's a number (s.isdigit()) before passing to int() (or at least catch the exception). I don't know if a time is useful with a birthday so it might be okay to just strip the time off starting with the T.

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.