I’m trying to embrace python a little more but I’m having problems catching a particular error. Here is the traceback.
2017-03-01 12:20:25.210662 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 602, in worker
function(ha.sanitize_timer_kwargs(args["kwargs"]))
File "/home/homeassistant/code/appdaemon/calalarm/calalarm.py", line 194, in checkifcalchanged
self.schedulealarm(self.roomowners[owner]["room"])
File "/home/homeassistant/code/appdaemon/calalarm/calalarm.py", line 266, in schedulealarm
meeting=self.getMeetings(self.roomowners[o]["calendar"])
File "/home/homeassistant/code/appdaemon/calalarm/calalarm.py", line 280, in getMeetings
response = request.execute()
File "/usr/local/lib/python3.4/dist-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/googleapiclient/http.py", line 835, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "/usr/local/lib/python3.4/dist-packages/googleapiclient/http.py", line 175, in _retry_request
raise exception
File "/usr/local/lib/python3.4/dist-packages/googleapiclient/http.py", line 162, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/oauth2client/transport.py", line 175, in new_request
redirections, connection_type)
File "/usr/local/lib/python3.4/dist-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1322, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1072, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1025, in _conn_request
response = conn.getresponse()
File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
response.begin()
File "/usr/lib/python3.4/http/client.py", line 351, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.4/socket.py", line 371, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.4/ssl.py", line 745, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.4/ssl.py", line 617, in read
v = self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1769)
2017-03-01 12:20:25.211232 WARNING ------------------------------------------------------------
2017-03-01 12:20:25.211663 WARNING ------------------------------------------------------------
This is ok, and really just needs to wait till the next loop and try again. I tried
try:
statement that throws this error
except SSLError
also tried
except ssl.SSLError
Both say that SSLError or ssl.SSLError are not defined. How do I trap this?