Hi,
I'm having trouble reaching reddit with PRAW. There are a couple other threads with similar problems SocketError when using PRAW and Did something change last night?.... I'm able to wget the same endpoint using the same user-agent.
Traceback (most recent call last):
File "testpraw.py", line 7, in <module>
for submission in subreddit.get_hot(limit=5):
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/__init__.py", line 434, in get_content
page_data = self.request_json(url, params=params)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/decorators.py", line 95, in wrapped
return_value = function(reddit_session, *args, **kwargs)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/__init__.py", line 469, in request_json
response = self._request(url, params, data)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/__init__.py", line 342, in _request
response = handle_redirect()
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/__init__.py", line 315, in handle_redirect
timeout=timeout, **kwargs)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/handlers.py", line 135, in wrapped
result = function(cls, **kwargs)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/handlers.py", line 54, in wrapped
return function(cls, **kwargs)
File "/home/mikenon/.local/lib/python2.7/site-packages/praw/handlers.py", line 90, in request
allow_redirects=False)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 246, in send
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.reddit.com', port=80): Max retries exceeded with url: /r/pics/.json?limit=2 (Caused by <class 'socket.error'>: [Errno 111] Connection refused)`
The script is pretty basic:
#!/usr/bin/python
import praw
from pprint import pprint
reddit = praw.Reddit(user_agent='testing praw /u/mikenon')
subreddit = reddit.get_subreddit('pics')
for submission in subreddit.get_hot(limit=2):
pprint(vars(submission))
for comment in praw.helpers.flatten_tree(submission.comments):
pprint(vars(comment))
Is it a proxy issue on PA's end? Or is there something I can fix?
Thank you