lfos / calcurse

A text-based calendar and scheduling application
https://calcurse.org
BSD 2-Clause "Simplified" License
983 stars 93 forks source link

calcurse-caldav: 'No such file or directory' (without specyfing any path) during init. #363

Open ftpd opened 3 years ago

ftpd commented 3 years ago

I'm trying to set everything up from https://www.calcurse.org/files/calcurse-caldav.html.
It goes ok until I'm trying to use calcurse-caldav --init=two-way --authcode '<some-code-here>'. The error message I get seems obvious, but lack of path to this 'no such file' get me confused:

Loading configuration from /home/f/.config/calcurse/caldav/config...
Connecting to apidata.googleusercontent.com...
Traceback (most recent call last):
  File "/bin/calcurse-caldav", line 742, in <module>
    cred = run_auth(authcode)
  File "/bin/calcurse-caldav", line 276, in run_auth
    credentials = init_auth(client_id, client_secret, scope, redirect_uri, authcode)
  File "/bin/calcurse-caldav", line 246, in init_auth
    credentials = oauth2_client.step2_exchange(authcode)
  File "/usr/lib/python3.9/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/oauth2client/client.py", line 2053, in step2_exchange
    resp, content = transport.request(
  File "/usr/lib/python3.9/site-packages/oauth2client/transport.py", line 280, in request
    return http_callable(uri, method=method, body=body, headers=headers,
  File "/usr/lib/python3.9/site-packages/httplib2/__init__.py", line 1820, in request
    conn = self.connections[conn_key] = connection_type(
  File "/usr/lib/python3.9/site-packages/httplib2/__init__.py", line 1270, in __init__
    context = _build_ssl_context(
  File "/usr/lib/python3.9/site-packages/httplib2/__init__.py", line 214, in _build_ssl_context
    context.load_verify_locations(ca_certs)
FileNotFoundError: [Errno 2] No such file or directory

My config file is:

[General]
Binary = calcurse
Hostname = apidata.googleusercontent.com
Path = /caldav/v2/me@mydomain.com/events/
AuthMethod = oauth2
SyncFilter = cal
InsecureSSL = yes
DryRun = No

[OAuth2]
ClientID = redacted.apps.googleusercontent.com
ClientSecret = redacted
Scope = https://www.googleapis.com/auth/calendar
#RedirectURI = http://127.0.0.1

I've seen in other tickets that the directory $XDG_DATA_HOME/calcurse/caldav must exist. It's there for me (autocreated, I suppose).
I don't know if it's worth mentioning, but my url I get after being redirected has &scpoe=https://www.googleapis.com/auth/calendar in it. It doesn't matter if I skip ir or even try to pass to --authcode - it doesn't work either way.

Bonus question: how to use multiple calendars from multiple Google accounts?

UtkarshVerma commented 3 years ago

Doing pip install --upgrade httplib2 fixed this for me.

Source: https://stackoverflow.com/questions/18557744/how-to-update-cacerts-txt-of-httplib2-for-github