praw-dev / prawtools

A collection of tools that interact with reddit's API providing moderator utilities, subreddit statistics, and keyword alerts.
BSD 2-Clause "Simplified" License
115 stars 25 forks source link

Error in praw-multiprocess when running comment_stream and submission_stream in separate threads #24

Closed Praisebetoscience closed 9 years ago

Praisebetoscience commented 9 years ago

I'm on windows 8.1. I have a multi-threaded reddit bot that runs three scans, one is using helpers.comment_stream, another that runs helpers.submission_stream. The third thread scans my inbox looking for messages every 60 secs to tell the bot to update configuration from a wiki.

Most of the time all three run without a problem. But intermittently my praw-multiprocess gives the following error twice (I'm assuming one for each stream thread):

Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 869, in run self._target(_self._args, *_self._kwargs) File "C:\Python34\lib\socketserver.py", line 616, in process_request_thread self.handle_error(request, client_address) File "C:\Python34\lib\socketserver.py", line 613, in process_request_thread self.finish_request(request, client_address) File "C:\Python34\lib\socketserver.py", line 344, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python34\lib\socketserver.py", line 669, in init self.handle() File "C:\Python34\lib\site-packages\praw\multiprocess.py", line 80, in handle cPickle.dump(retval, self.wfile, # pylint: disable-msg=E1101 UnboundLocalError: local variable 'retval' referenced before assignment

Afterwards, I stop seeing requests for either of my stream threads. The mail requests still show up every 60 seconds. I have to restart the bot to recover.

Praisebetoscience commented 9 years ago

Ugh, wrong project.. my apologies.