最近Mac下python开发github项目动态外链引用标签检查工具,需要借助requests库http API请求。考虑到公司github上项目很多,为提高性能,采用多线程方式请求、解析回显。
但总是报以下异常:
Exception in thread Thread-7325:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/Users/bill.li/PycharmProjects/tags_checking-devops/test.py", line 30, in run
test()
File "/Users/bill.li/PycharmProjects/tags_checking-devops/test.py", line 20, in test
response_data = requests.get(full_url_path, headers=head_dict, params=params)
File "/Users/bill.li/virtualenv/lib/python2.7/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/Users/bill.li/virtualenv/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/bill.li/virtualenv/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)