使用IronPython时,我发出了一个URL请求来获取XML(带有python请求),在VisualStudio的控制台中我收到以下错误:
failed to parse CPython sys.version: '2.7.3 ()'
这是什么意思?我该如何解决?
这是导致问题的Python代码:
def __xml_retrieve(self, query_string):
""" Handles MB speed limits """
attempt = 0
while attempt <= self.max_attempts:
attempt += 1
# raises connectionerror; still not managed
try:
r = requests.get(query_string)
except Exception as exc:
print exc.message
if r.status_code == 503:
time.sleep(self.speed_limit_pause)
elif r.status_code == 200:
return r.content
return
调用request.get(query_string)时出现的问题。这是请求库:http://docs.python-requests.org/en/latest/。