Python requests/urllib3 raises 'httplib.BadStatusLine' error if called many times?

﹥>﹥吖頭↗ 提交于 2019-12-06 09:12:06

This is almost certainly either the server misbehaving or the connection being pre-emptively closed. Could you run it 99 times (assuming your 100 number is accurate) and on the 100th time edit the file to do:

import pdb

# before line with the call to requests
pdb.set_trace()

And then follow the stack trace through the HTTPAdapter and into urllib3 and look at the response urllib3 gets?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!