0

我用谷歌翻译翻译了一个相当大的文本,并在调用线程中的拆分请求时加快了进程。但是,线程有时会抛出 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
4

0 回答 0