Forums

Python 3.3 + PRAW not working?

Obviously there appears to have been some issues using praw in the past, and most of those seem to be with Py2.7, just wondering if its known whether this is the same thing w/ the proxies?

Traceback (most recent call last):
File "startBot.py", line 17, in <module>
r.login()
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/__init__.py", line 1230, in login
self.request_json(self.config['login'], data=data)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/decorators.py", line 161, in wrapped
return_value = function(reddit_session, *args, **kwargs)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/__init__.py", line 510, in request_json
response = self._request(url, params, data)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/__init__.py", line 374, in _request
response = handle_redirect()
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/__init__.py", line 347, in handle_redirect
timeout=timeout, **kwargs)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/handlers.py", line 135, in wrapped
result = function(cls, **kwargs)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/handlers.py", line 54, in wrapped
return function(cls, **kwargs)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/praw/handlers.py", line 90, in request
allow_redirects=False)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/requests/sessions.py", line 557, in send
r = adapter.send(request, **kwargs)
File "/home/stats94/.virtualenvs/django16/local/lib/python3.3/site-packages/requests/adapters.py", line 407, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

Nope, PRAW still has a bug with HTTPS proxies. You can track the issue on their github here.

Paying accounts have unrestricted internet, so they just work. But if you want to get it working for free, your best bet is to get into the PRAW codebase and submit a pull request they like!

As you have PRAW installed in your virtualenv, you can make the changes to the code manually -- the changes to the __init.py__ from this diff should do the job.