Advertisement
Guest User

Untitled

a guest
Jul 21st, 2015
1,691
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.00 KB | None
  1. Rate limit reached. Sleeping for: 700
  2. ---------------------------------------------------------------------------
  3. TypeError Traceback (most recent call last)
  4. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
  5. 371 try: # Python 2.7, use buffering of HTTP responses
  6. --> 372 httplib_response = conn.getresponse(buffering=True)
  7. 373 except TypeError: # Python 2.6 and older
  8.  
  9. TypeError: getresponse() got an unexpected keyword argument 'buffering'
  10.  
  11. During handling of the above exception, another exception occurred:
  12.  
  13. ConnectionResetError Traceback (most recent call last)
  14. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
  15. 543 timeout=timeout_obj,
  16. --> 544 body=body, headers=headers)
  17. 545
  18.  
  19. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
  20. 373 except TypeError: # Python 2.6 and older
  21. --> 374 httplib_response = conn.getresponse()
  22. 375 except (SocketTimeout, BaseSSLError, SocketError) as e:
  23.  
  24. /usr/lib64/python3.4/http/client.py in getresponse(self)
  25. 1170 try:
  26. -> 1171 response.begin()
  27. 1172 assert response.will_close != _UNKNOWN
  28.  
  29. /usr/lib64/python3.4/http/client.py in begin(self)
  30. 350 while True:
  31. --> 351 version, status, reason = self._read_status()
  32. 352 if status != CONTINUE:
  33.  
  34. /usr/lib64/python3.4/http/client.py in _read_status(self)
  35. 312 def _read_status(self):
  36. --> 313 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  37. 314 if len(line) > _MAXLINE:
  38.  
  39. /usr/lib64/python3.4/socket.py in readinto(self, b)
  40. 373 try:
  41. --> 374 return self._sock.recv_into(b)
  42. 375 except timeout:
  43.  
  44. /usr/lib64/python3.4/ssl.py in recv_into(self, buffer, nbytes, flags)
  45. 750 self.__class__)
  46. --> 751 return self.read(nbytes, buffer)
  47. 752 else:
  48.  
  49. /usr/lib64/python3.4/ssl.py in read(self, len, buffer)
  50. 622 if buffer is not None:
  51. --> 623 v = self._sslobj.read(len, buffer)
  52. 624 else:
  53.  
  54. ConnectionResetError: [Errno 104] Connection reset by peer
  55.  
  56. During handling of the above exception, another exception occurred:
  57.  
  58. ProtocolError Traceback (most recent call last)
  59. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
  60. 369 retries=self.max_retries,
  61. --> 370 timeout=timeout
  62. 371 )
  63.  
  64. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
  65. 596 retries = retries.increment(method, url, error=e, _pool=self,
  66. --> 597 _stacktrace=sys.exc_info()[2])
  67. 598 retries.sleep()
  68.  
  69. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
  70. 244 if read is False:
  71. --> 245 raise six.reraise(type(error), error, _stacktrace)
  72. 246 elif read is not None:
  73.  
  74. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
  75. 308 if value.__traceback__ is not tb:
  76. --> 309 raise value.with_traceback(tb)
  77. 310 raise value
  78.  
  79. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
  80. 543 timeout=timeout_obj,
  81. --> 544 body=body, headers=headers)
  82. 545
  83.  
  84. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
  85. 373 except TypeError: # Python 2.6 and older
  86. --> 374 httplib_response = conn.getresponse()
  87. 375 except (SocketTimeout, BaseSSLError, SocketError) as e:
  88.  
  89. /usr/lib64/python3.4/http/client.py in getresponse(self)
  90. 1170 try:
  91. -> 1171 response.begin()
  92. 1172 assert response.will_close != _UNKNOWN
  93.  
  94. /usr/lib64/python3.4/http/client.py in begin(self)
  95. 350 while True:
  96. --> 351 version, status, reason = self._read_status()
  97. 352 if status != CONTINUE:
  98.  
  99. /usr/lib64/python3.4/http/client.py in _read_status(self)
  100. 312 def _read_status(self):
  101. --> 313 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  102. 314 if len(line) > _MAXLINE:
  103.  
  104. /usr/lib64/python3.4/socket.py in readinto(self, b)
  105. 373 try:
  106. --> 374 return self._sock.recv_into(b)
  107. 375 except timeout:
  108.  
  109. /usr/lib64/python3.4/ssl.py in recv_into(self, buffer, nbytes, flags)
  110. 750 self.__class__)
  111. --> 751 return self.read(nbytes, buffer)
  112. 752 else:
  113.  
  114. /usr/lib64/python3.4/ssl.py in read(self, len, buffer)
  115. 622 if buffer is not None:
  116. --> 623 v = self._sslobj.read(len, buffer)
  117. 624 else:
  118.  
  119. ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  120.  
  121. During handling of the above exception, another exception occurred:
  122.  
  123. ConnectionError Traceback (most recent call last)
  124. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/binder.py in execute(self)
  125. 186 auth=auth,
  126. --> 187 proxies=self.api.proxy)
  127. 188 except Exception as e:
  128.  
  129. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
  130. 464 send_kwargs.update(settings)
  131. --> 465 resp = self.send(prep, **send_kwargs)
  132. 466
  133.  
  134. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/sessions.py in send(self, request, **kwargs)
  135. 572 # Send the request
  136. --> 573 r = adapter.send(request, **kwargs)
  137. 574
  138.  
  139. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
  140. 414 except (ProtocolError, socket.error) as err:
  141. --> 415 raise ConnectionError(err, request=request)
  142. 416
  143.  
  144. ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  145.  
  146. During handling of the above exception, another exception occurred:
  147.  
  148. TweepError Traceback (most recent call last)
  149. <ipython-input-1-9618037301f5> in <module>()
  150. 2
  151. 3 TOTAL = 30000
  152. ----> 4 get_tweets(TOTAL, 'Confederate')
  153.  
  154. /home/sean/twitter_scripts/nsa_sentiment/get_tweets.py in get_tweets(n, target)
  155. 45
  156. 46 def get_tweets(n, target):
  157. ---> 47 tweets = search(cursor, target, n)
  158. 48 print('Got the tweets')
  159. 49 df = make_df(tweets, target)
  160.  
  161. /home/sean/twitter_scripts/nsa_sentiment/get_tweets.py in search(cursor, query, total_tweets)
  162. 17
  163. 18 def search(cursor, query, total_tweets):
  164. ---> 19 return list(cursor(query).items(total_tweets))
  165. 20
  166. 21
  167.  
  168. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/cursor.py in __next__(self)
  169. 47
  170. 48 def __next__(self):
  171. ---> 49 return self.next()
  172. 50
  173. 51 def next(self):
  174.  
  175. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/cursor.py in next(self)
  176. 195 if self.current_page is None or self.page_index == len(self.current_page) - 1:
  177. 196 # Reached end of current page, get the next page...
  178. --> 197 self.current_page = self.page_iterator.next()
  179. 198 self.page_index = -1
  180. 199 self.page_index += 1
  181.  
  182. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/cursor.py in next(self)
  183. 106
  184. 107 if self.index >= len(self.results) - 1:
  185. --> 108 data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
  186. 109
  187. 110 if hasattr(self.method, '__self__'):
  188.  
  189. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/binder.py in _call(*args, **kwargs)
  190. 237 return method
  191. 238 else:
  192. --> 239 return method.execute()
  193. 240
  194. 241 # Set pagination mode
  195.  
  196. /home/sean/venvs/ipython-twitter/lib/python3.4/site-packages/tweepy/binder.py in execute(self)
  197. 187 proxies=self.api.proxy)
  198. 188 except Exception as e:
  199. --> 189 raise TweepError('Failed to send request: %s' % e)
  200. 190 rem_calls = resp.headers.get('x-rate-limit-remaining')
  201. 191 if rem_calls is not None:
  202.  
  203. TweepError: Failed to send request: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Advertisement
RAW Paste Data Copied
Advertisement