gpt4 book ai didi

python - Python Google Drive API 出现 SSL 错误

转载 作者:太空宇宙 更新时间:2023-11-03 19:09:33 25 4
gpt4 key购买 nike

我写了一个简单的代码,和https://developers.google.com/drive/quickstart-python上的基本一样每次第一次尝试后我都会遇到同样的错误:

# Traceback (most recent call last):
# File "C:/plug-ins/googleDrive.py", line 35, in <lambda>
# self.authAction = self.menu.addAction( 'Authentication', lambda: self.runAuthentication() )
# File "C:/plug-ins/googleDrive.py", line 46, in runAuthentication
# credentials = self.flow.step2_exchange( unicode(text) )
# File "D:/Python\oauth2client\util.py", line 120, in positional_wrapper
# return wrapped(*args, **kwargs)
# File "D:/Python\oauth2client\client.py", line 1131, in step2_exchange
# headers=headers)
# File "D:/Python\httplib2\__init__.py", line 1597, in request
# (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
# File "D:/Python\httplib2\__init__.py", line 1345, in _request
# (response, content) = self._conn_request(conn, request_uri, method, body, headers)
# File "D:/Python\httplib2\__init__.py", line 1281, in _conn_request
# conn.connect()
# File "D:/Python\httplib2\__init__.py", line 1013, in connect
# self.disable_ssl_certificate_validation, self.ca_certs)
# File "D:/Python\httplib2\__init__.py", line 80, in _ssl_wrap_socket
# cert_reqs=cert_reqs, ca_certs=ca_certs)
# File "C:\python26\ssl.py", line 350, in wrap_socket
# File "C:\python26\ssl.py", line 118, in __init__
# File "C:\python26\ssl.py", line 293, in do_handshake
# ssl.SSLError: [Errno 8] _ssl.c:480: EOF occurred in violation of protocol

我在 Python 2.6.4、httplib2 v0.7.7 和 google-api-python-client v1.0b9 下运行它。如果有人有想法......我将非常感激。

最佳答案

该版本的 google-api-python-client (v1.0b9) 是客户端库的 beta 9,您应该升级到发布版本,即 v1.0。

至于“EOF发生违反协议(protocol)”,我只看到发生在不稳定的网络连接上,这里是这种情况吗?

关于python - Python Google Drive API 出现 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13480263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com