IronPython - URL请求中的错误

时间:2013-05-14 13:49:43

标签: c# python ironpython python-requests

使用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/

0 个答案:

没有答案