← Back to team overview

openerp-india team mailing list archive

[Bug 886038] Re: Caldav Exception on Non-English(Chinese) Attendee Information.

 

Same problem with other non-ascii languages. (Accents in french)
In fact, str() functions are used in /caldav/calendar.py for the attendee, elsewhere in the code, tools.ustr() function is used. 
You can change str() function by tools.ustr() on lines 1284 and 1288 and it works !

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/886038

Title:
  Caldav Exception on Non-English(Chinese) Attendee Information.

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  Hi,

  We are using OpenERP 6.03 and we have noticed when trying to sync the meeting calendar with non-English ( for us it's Chinese) attendee information, the client ( we've tested with Thundirbird/Lighting1.0B7 ) will receive 500 Server Internal Error, and we have server side log like this:
  =========================================================================================
  [2011-11-04 16:43:01,569][?] INFO:auth:Found user="foo", passwd="***" for db="bar"
  [2011-11-04 16:43:04,926][bar] ERROR:http:Could not run do_REPORT
  Traceback (most recent call last):
    File "/usr/share/pyshared/openerp-server/service/websrv_lib.py", line 299, in _handle_one_foreign
      method()
    File "/usr/lib/python2.7/dist-packages/DAV/WebDAVServer.py", line 364, in do_REPORT
      DATA = '%s\n' % rp.createResponse()
    File "/usr/lib/python2.7/dist-packages/DAV/propfind.py", line 93, in createResponse
      df = self.create_prop()
    File "/usr/share/pyshared/openerp-server/addons/document_webdav/webdav.py", line 333, in create_prop
      return super_create_prop(self)
    File "/usr/lib/python2.7/dist-packages/DAV/report.py", line 120, in create_prop
      gp,bp=self.get_propvalues(newuri)
    File "/usr/lib/python2.7/dist-packages/DAV/propfind.py", line 350, in get_propvalues
      r=ddc.get_prop(uri,ns,prop)
    File "/usr/share/pyshared/openerp-server/addons/document_webdav/dav_fs.py", line 308, in get_prop
      res = node.get_dav_eprop(cr, ns, propname)
    File "/usr/share/pyshared/openerp-server/addons/document/nodes.py", line 340, in get_dav_eprop
      r = m(cr)
    File "/usr/share/pyshared/openerp-server/addons/caldav/caldav_node.py", line 475, in _get_caldav_calendar_data
      return self.get_data(cr)
    File "/usr/share/pyshared/openerp-server/addons/caldav/caldav_node.py", line 471, in get_data
      res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context)
    File "/usr/share/pyshared/openerp-server/addons/caldav/calendar.py", line 690, in export_cal
      self.create_ics(cr, uid, datas, line.name, ical, context=context)
    File "/usr/share/pyshared/openerp-server/addons/caldav/calendar.py", line 390, in create_ics
      data[map_field], vevent, context=context)
    File "/usr/share/pyshared/openerp-server/addons/caldav/calendar.py", line 1286, in export_cal
      cn_val = [str(attendee[a_val['field']])]
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
  [2011-11-04 16:43:04,927][bar] ERROR:http:code 500, message Internal error
  =========================================================================================
  To avoid this situation, I did a little modify: 

  1282c1282
  <                         attendee_add.params[a_key] = [unicode(attendee[a_val['field']])]
  ---
  >                         attendee_add.params[a_key] = [str(attendee[a_val['field']])]
  1286c1286
  <                     cn_val = [unicode(attendee[a_val['field']])]
  ---
  >                     cn_val = [str(attendee[a_val['field']])]

  Now looks like I can sync with my test environment. Please check
  whether it's proper or not.

  Regards,
  Ian

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/886038/+subscriptions


References