indictranstech / GCAL

Other
8 stars 19 forks source link

ValueError: unconverted data remains: -04:00 #10

Open sjudy opened 9 years ago

sjudy commented 9 years ago

After a fresh pull, I am still receiving the same error in file "/home/erpnext/frappe-bench/apps/gcal/gcal/tasks.py",

Traceback (innermost last): File "/home/erpnext/frappe-bench/apps/frappe/frappe/app.py", line 67, in application response = frappe.handler.handle() File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 74, in handle execute_cmd(cmd) File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 99, in execute_cmd ret = frappe.call(method, _frappe.form_dict) File "/home/erpnext/frappe-bench/apps/frappe/frappe/init.py", line 757, in call return fn(args, *_newargs) File "/home/erpnext/frappe-bench/apps/gcal/gcal/gcal_sync/doctype/sync_configuration/sync_configuration.py", line 102, in sync_calender sync_google_calendar(credentials) File "/home/erpnext/frappe-bench/apps/gcal/gcal/tasks.py", line 64, in sync_google_calendar update_event(e_name, event) if e_name else save_event(event) File "/home/erpnext/frappe-bench/apps/gcal/gcal/tasks.py", line 76, in save_event e = set_values(e, event) File "/home/erpnext/frappe-bench/apps/gcal/gcal/tasks.py", line 95, in set_values doc.starts_on = get_formatted_date(start_date) File "/home/erpnext/frappe-bench/apps/gcal/gcal/tasks.py", line 223, in get_formatted_date date = datetime.strptime(str_date, '%Y-%m-%dT%H:%M:%S').strftime("%Y-%m-%d %H:%M:%S") File "/usr/lib/python2.7/_strptime.py", line 328, in _strptime data_string[found.end():]) ValueError: unconverted data remains: -04:00

sjudy commented 9 years ago

I disabled the line that checks for the unconverted data in line 328 of _strptime.py and it works when that error is not thrown. I think if you just trim the timezone offset (expressed by '-04:00' in my case) then that should fix this issue.