Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection aborted error 10053 after running the code for longer duration. #835

Closed
Prashant30 opened this issue Jan 15, 2017 · 1 comment
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate Improvement This is regarding an improvement to an existing feature

Comments

@Prashant30
Copy link

While getting the followers list of any famous handle I am getting the following error after 2-3 time frames(i.e, 15+15+15 mins).
My code goes like this:

*importing and OAuth*

api = tweepy.API(auth, wait_on_rate_limit=True)
users = tweepy.Cursor(api.followers, screen_name = 'realmadrid', count = 200).items()
with open('madrid_Followers.txt','a') as f:
    while True:
        user = next(users)
        f.write(user.screen_name)
        f.write('\n')
        print(user.screen_name)

after 2-3 time frames or 30-45 mins I am getting the following error:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 391, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 387, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Python34\lib\http\client.py", line 1171, in getresponse
    response.begin()
  File "C:\Python34\lib\http\client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "C:\Python34\lib\http\client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python34\lib\socket.py", line 374, in readinto
    return self._sock.recv_into(b)
  File "C:\Python34\lib\ssl.py", line 751, in recv_into
    return self.read(nbytes, buffer)
  File "C:\Python34\lib\ssl.py", line 623, in read
    v = self._sslobj.read(len, buffer)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\requests\adapters.py", line 423, in send
    timeout=timeout
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\util\retry.py", line 334, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\packages\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 391, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 387, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Python34\lib\http\client.py", line 1171, in getresponse
    response.begin()
  File "C:\Python34\lib\http\client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "C:\Python34\lib\http\client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python34\lib\socket.py", line 374, in readinto
    return self._sock.recv_into(b)
  File "C:\Python34\lib\ssl.py", line 751, in recv_into
    return self.read(nbytes, buffer)
  File "C:\Python34\lib\ssl.py", line 623, in read
    v = self._sslobj.read(len, buffer)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionAbortedError(10053, 
'An established connection was aborted by the software in your host machine', None, 10053, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\binder.py", line 187, in execute
    proxies=self.api.proxy)
  File "C:\Python34\lib\site-packages\requests\sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python34\lib\site-packages\requests\sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python34\lib\site-packages\requests\adapters.py", line 473, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionAbortedError(10053, 
'An established connection was aborted by the software in your host machine', None, 10053, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\python\MB\Data Mining\timeline.py", line 21, in <module>
    user = next(users)
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\cursor.py", line 49, in __next__
    return self.next()
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\cursor.py", line 197, in next
    self.current_page = self.page_iterator.next()
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\cursor.py", line 75, in next
    **self.kargs)
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\binder.py", line 245, in _call
    return method.execute()
  File "C:\Python34\lib\site-packages\tweepy-3.6.0-py3.4.egg\tweepy\binder.py", line 189, in execute
    raise TweepError('Failed to send request: %s' % e)
tweepy.error.TweepError: Failed to send request: ('Connection aborted.', ConnectionAbortedError(10053, 
'An established connection was aborted by the software in your host machine', None, 10053, None))

Please help me out with this. I am using Windows 7, python 3.4 and tweepy 3.6. I tried this code with both IDLE as well as Windows Powershell but still no luck. I also tried the code with time.sleep(15*60) but again same issue prevails. Next, I checked my connection which is also working fine.

@Harmon758
Copy link
Member

Closing this in favor of #1606

@Harmon758 Harmon758 added Bug This is regarding a bug with the library Duplicate This is a duplicate Improvement This is regarding an improvement to an existing feature labels Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate Improvement This is regarding an improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants