我有一个正在运行的请求程序,但偶尔会收到以下错误消息:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 376, in _make_request
httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 378, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 1174, in getresponse
response.begin()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 282, in begin
version, status, reason = self._read_status()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 251, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\adapters.py", line 376, in send
timeout=timeout
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 609, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\util\retry.py", line 247, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\packages\six.py", line 309, in reraise
raise value.with_traceback(tb)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 378, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 1174, in getresponse
response.begin()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 282, in begin
version, status, reason = self._read_status()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\http\client.py", line 251, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\pool.py", line 47, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "C:\Users\Acer-PC\Desktop\Sineko Official Scripts\Jessie\cURL_insta_test.py", line 197, in run
if check_account(account, request):
File "C:\Users\Acer-PC\Desktop\Sineko Official Scripts\Jessie\cURL_insta_test.py", line 20, in check_account
account_url = instagram_session.get("https://instagram.com/{}".format(account))
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\site-packages\requests\adapters.py", line 426, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Acer-PC\Desktop\Sineko Official Scripts\Jessie\cURL_insta_test.py", line 219, in <module>
pool.starmap(run, accounts)
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\pool.py", line 268, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "C:\Users\Acer-PC\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\pool.py", line 608, in get
raise self._value
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
我想我能理解这是因为我一次发送了太多的请求,虽然只有7秒左右,但我想知道的是,为什么这个错误没有说明是哪一行或是什么请求导致了错误(或者可能是这样,我错过了,如果是的话,请告诉我在哪里),我尝试了尝试,除了TypeError,我不是把它放错地方就是用错了,我应该把Try和Except放在哪里?关于发送的请求?如果是的话,是不是我应该找的打字错误?在
编辑:检查了评论中列出的两个github线程,第一个线程说要升级,但我已经在请求2.9,他们说这是2.7以上的任何东西,第二个似乎没有得出一个修复的结论,或者我自己的尝试,除了捕捉错误,这是我的代码:https://github.com/Fuledbyramen/soquestion
目前没有回答
相关问题 更多 >
编程相关推荐