首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有工作的httplib.ResponseNotReady

没有工作的httplib.ResponseNotReady
EN

Stack Overflow用户
提问于 2020-07-15 15:03:17
回答 1查看 275关注 0票数 0

我正试图用python将一个文件发送到google驱动器,但我在某种程度上陷入了困境。

当我运行下面的代码,从谷歌打开的网页正确,我可以选择我的帐户,它给我祝贺信息:“认证流已完成.”。

代码语言:javascript
复制
import os
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from requests.auth import HTTPBasicAuth

#Then we authenticate to google
print("debug-2")
g_login = GoogleAuth()
print("debug-1")
g_login.LocalWebserverAuth()
print("debug0")
drive = GoogleDrive(g_login)

#And we send the file
print("debug1")
with open("test.txt","r") as file:
    print("debug2")
    file_drive = drive.CreateFile({'title':os.path.basename(file.name) })  
    file_drive.SetContentString(file.read())
    file1_drive.Upload()
print("debug3")

看起来很棒,但在我的shell中,代码被卡在“"LocalWebserverAuth()”调试-1“上,就好像从未工作过一样。此外,在我的驱动器仍然没有文件,所以上传是真的不工作,而不仅仅是“视觉卡住”。

下面是shell中的消息:

当我让它自行结束时,我会得到一个python错误:httplib.ResponseNotReady

任何想法都欢迎!

更新:连接问题。我是因为不使用代理而造成的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-15 21:33:49

此错误的根本原因可能与firewall/antivirus阻塞传入/传出连接有关。试着禁用它,看看它是否解决了问题。

您可能还会看到其他解决方案这里

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62917914

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档