badstatusline例外,我得到'badstatusline'例外,对于我试图获取网站之一。 问题只显示在Linux上,但一切工程确定在Windows上。 测试上:Python的请求库抛出仅在Linux
64位Windows 7,Python中的2.6.x 32位 - >确定
的Windows XP SP3,Python的2.7.3 - >确定
的Xubuntu 12.10的Python 2.7.3 - > badstatusline
Ubuntu的LTS 12.04,Python的2.7.3 - > badstatusline
这是我的代码:
import requests
url = 'https://somewebsite.com'
try:
r = requests.get(url, verify=False)
except Exception, e:
print e
我曾尝试添加自定义标头的要求,但它并没有帮助。 可能是什么问题?
我试图与wget的,但我会收到以下消息:发送
HTTP请求,正在等待回应...未收到任何数据。
EDIT1:
例外: HTTPSConnectionPool(主机= 'somesite.com',端口= 443):最大重试次数超过与网址:由类引起的 'httplib.BadStatusLine': '')
这是httplib的:
def _read_status(self):
# Initialize with Simple-Response defaults
line = self.fp.readline()
if self.debuglevel > 0:
print "reply:", repr(line)
if not line:
# Presumably, the server closed the connection before
# sending a valid response.
raise BadStatusLine(line)
我可以绕过这一点,但不是解决办法。解决办法是,如果我的请求可能更像FF,并且无论如何都可以访问数据。 再次,它的工作原理就像Win7和Win XP的魅力。
EDIT2: 卷曲在Windows 卷曲在Linux上的报告“从服务器空应答”的报道一样 -
2013-07-09
Yagosh
+0
显示完整的异常和堆栈跟踪。 –