0

I've successfully created and updated the calendar events from python. And the below is my code to delete an event from python code.

def delete_google_event(self, cr, uid, task, user):
        g_client = gtools.gcal.google_calendar_interface()
        g_client.connect(user.google_email, user.google_password)
        g_client.delete(task.google_event_id)
        message = "Google event deleted, old id: %s" % (task.google_event_id)

I get the below error when using the above code. From the error message BadStatusLine: '' i understand that i receive a request from the server that system do not understand. But not sure how to solve it. And also the error seems to be with google cal API. Will there be any versioning prob? (i do it in openerp and i guess it's not a problem of openerp)

{/usr/lib/python2.7/dist-packages/gtools/gcal.py} deleting http://www.google.com/calendar/feeds/default/private/full/fpdoqrq4q5rroggkn2uaamojb0
{/usr/lib/python2.7/dist-packages/gtools/gcal.py} quering element uri: http://www.google.com/calendar/feeds/default/private/full/fpdoqrq4q5rroggkn2uaamojb0
!!!!http://localhost:9888/
!!!!
!!!!http://localhost:9888/
!!!!http://localhost:9888/
!!!!
!!!!http://localhost:9888/
2013-09-02 12:21:16,945 17720 ERROR jul-16-7575-t1 openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/opt/workspace/openerp space/openerp-7.0-20130716-231027/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/workspace/openerp space/openerp-7.0-20130716-231027/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/workspace/openerp space/openerp-7.0-20130716-231027/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/workspace/openerp space/openerp-7.0-20130716-231027/openerp/addons/google_calendar_task_sync/project_google_calendar.py", line 67, in unlink
    self.delete_google_event(cr, uid, task, goog_uid)
  File "/opt/workspace/openerp space/openerp-7.0-20130716-231027/openerp/addons/google_calendar_task_sync/project_google_calendar.py", line 92, in delete_google_event
    g_client.delete(task.google_event_id)
  File "/usr/lib/python2.7/dist-packages/gtools/gcal.py", line 78, in delete
    self.cal_srv.DeleteEvent(event_uri)
  File "/usr/lib/pymodules/python2.7/gdata/calendar/service.py", line 313, in DeleteEvent
    url_params=url_params, escape_params=escape_params)
  File "/usr/lib/pymodules/python2.7/gdata/service.py", line 1429, in Delete
    headers=extra_headers, url_params=url_params)
  File "/usr/lib/pymodules/python2.7/atom/__init__.py", line 92, in optional_warn_function
    return f(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/atom/service.py", line 185, in request
    data=data, headers=all_headers)
  File "/usr/lib/pymodules/python2.7/gdata/auth.py", line 725, in perform_request
    return http_client.request(operation, url, data=data, headers=headers)
  File "/usr/lib/pymodules/python2.7/atom/http.py", line 174, in request
    return connection.getresponse()
  File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 407, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
    raise BadStatusLine(line)
BadStatusLine: ''

I've referred this link Why am I getting this error in python ? (httplib). Still not sure of the prob. Kindly give me some clues to fix this. Thanks a lot for your time.

1 Answer 1

0

Hurrah!! It works fine in the Direct Connection. But not under proxy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.