You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python上传文件至Google Drive在Windows Server 2008出现写入超时错误

Google Drive文件上传代码在Windows Server 2008下报错问题

我编写了用于上传(创建和更新)文件至Google Drive的Python代码,该代码在Windows 10 + Python 3.9环境下可正常运行,但在Windows Server 2008 + Python 3.8环境下报错(注:Python 3.8是支持Windows Server 2008的最高版本)。

在Windows Server 2008环境下,代码可正常列出Google Drive中的文件,但执行创建或更新文件操作时出现问题,我怀疑这与Windows Server 2008的SSL配置有关。

具体报错信息

C:\backupmgr>python drive.py
Traceback (most recent call last):
  File "drive.py", line 112, in <module>
    envia_zip('sexta.7z')
  File "drive.py", line 104, in envia_zip
    file = service.files().create(body=file_metadata, media_body=media).execute(
)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\http.py", line 923, in execute
    resp, content = _retry_request(
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\http.py", line 222, in _retry_request
    raise exception
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\http.py", line 191, in _retry_request
    resp, content = http.request(uri, method, *args, **kwargs)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\google_auth_httplib2.py", line 218, in request
    response, content = self.http.request(
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\httplib2\__init__.py", line 1720, in request
    (response, content) = self._request(
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\httplib2\__init__.py", line 1440, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\site-packages\httplib2\__init__.py", line 1363, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1046, in _send_output
    self.send(chunk)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 968, in send
    self.sock.sendall(data)
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1204, in sendall
    v = self.send(byte_view[count:])
  File "C:\Users\Administrador\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1173, in send
    return self._sslobj.write(data)
socket.timeout: The write operation timed out

内容的提问来源于stack exchange,提问作者flierd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 09:55:23