Google 翻訳を使用してかなり大きなテキストを翻訳し、プロセスを高速化するために、分割されたリクエストをスレッドで呼び出しています。ただし、スレッドが SSL ハンドシェイク エラーをスローすることがあります。何が起こっている?
ここにトレースがあります
File "/Users/[PROJECT ROOT]/source/graba/models.py", line 1558, in google_translate_list_strings
service = build('translate', 'v2', developerKey='[MY DEV KEY]')
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/oauth2client/util.py", line 120, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/apiclient/discovery.py", line 193, in build
resp, content = http.request(requested_url)
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1588, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1336, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
conn.connect()
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1014, in connect
self.disable_ssl_certificate_validation, self.ca_certs)
File "/Users/[PROJECT ROOT]/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 80, in _ssl_wrap_socket
cert_reqs=cert_reqs, ca_certs=ca_certs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 372, in wrap_socket
ciphers=ciphers)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 134, in __init__
self.do_handshake()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 296, in do_handshake
self._sslobj.do_handshake()
SSLError: [Errno 8] _ssl.c:503: EOF occurred in violation of protocol