title: Praw AttributeError: can't set attribute
body: <p>I coded a reddit bot that will search through a subreddit's comments, and if a comment says feels it will reply to it. It then writes the comment id into a text file so that it never comments on the same comment twice.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import praw
  import time
  import sys
  import random
  
  r = praw.Reddit('Posts Feels gif in response to someone saying feels'
                  'by: Mjone77')
  r.login('Feels_Bot', 'nottherealpassword')
  file = open('Commentids.txt', 'r')
  already_done = file.read()
  file.close()
  times = 0
  feels = 0
  
  
  while True:
     # try: 
          subreddit = r.get_subreddit('frozen')
          subreddit_comments = subreddit.get_comments()
          times+=1
          for comment in subreddit_comments:
              commentSays = comment.body
              commentSays = commentSays.lower()
              #print(commentSays)
              #print('\n')
              #if 'stop feels_bot' in commentSays:
                  #sys.exit("Commanded to stop.")
              if comment.id not in already_done and 'feels' in commentSays:
                  gif = random.randrange(0,3)
                  if gif == 0:
                      comment.reply('[Relevant](http://i.imgur.com/pXBrf.gif)\n\n___\n\n^I ^am ^a ^bot ^not ^a ^real ^redditor \n\n ^Please ^contact ^/u/Mjone77 ^with ^any ^problems')
                  if gif == 1:
                      comment.reply('[Relevant](http://gfycat.com/BraveSerpentineAzurevase)\n\n___\n\n^I ^am ^a ^bot ^not ^a ^real ^redditor \n\n ^Please ^contact ^/u/Mjone77 ^with ^any ^problems')
                  if gif == 2:
                      comment.reply('[Relevant](http://www.gfycat.com/PlushMeanCowrie)\n\n___\n\n^I ^am ^a ^bot ^not ^a ^real ^redditor \n\n ^Please ^contact ^/u/Mjone77 ^with ^any ^problems')
                  already_done = already_done+' '+comment.id
                  file = open('Commentids.txt', 'w')
                  file.write(already_done)
                  file.close()
                  #print('Commented~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
                  time.sleep(5)
                  feels+=1
          print('\n\n\n\n\n\n\n')        
          print('Feels:')
          print(feels)
          print('Times Ran:')
          print(times)
          time.sleep(60)
      #except AttriuteError:
          #pass
  </code></pre>
  
  <p>I ran it and left it running and came back to an HTTP Error 504: Gateway Time-out. Does anyone know how to keep that from happening or make it wait 60 seconds then try again?</p>
  
  <p>Also, when I ran it again, without changing any code from the working program, it decided to give me this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Me\Desktop\My Programs\Feels Bot\Feels Bot\FeelsBot.py", line 20, in &lt;module&gt;
      for comment in subreddit_comments:
    File "C:\Python34\lib\site-packages\praw\__init__.py", line 471, in get_content
      page_data = self.request_json(url, params=params)
    File "C:\Python34\lib\site-packages\praw\decorators.py", line 161, in wrapped
      return_value = function(reddit_session, *args, **kwargs)
    File "C:\Python34\lib\site-packages\praw\__init__.py", line 516, in request_json
      data = json.loads(response, object_hook=hook)
    File "C:\Python34\lib\json\__init__.py", line 331, in loads
      return cls(**kw).decode(s)
    File "C:\Python34\lib\json\decoder.py", line 343, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:\Python34\lib\json\decoder.py", line 359, in raw_decode
      obj, end = self.scan_once(s, idx)
    File "C:\Python34\lib\site-packages\praw\__init__.py", line 403, in _json_reddit_objecter
      return object_class.from_api_response(self, json_data['data'])
    File "C:\Python34\lib\site-packages\praw\objects.py", line 58, in from_api_response
      return cls(reddit_session, json_dict=json_dict)
    File "C:\Python34\lib\site-packages\praw\objects.py", line 514, in __init__
      underscore_names=['replies'])
    File "C:\Python34\lib\site-packages\praw\objects.py", line 72, in __init__
      self.has_fetched = self._populate(json_dict, fetch)
    File "C:\Python34\lib\site-packages\praw\objects.py", line 141, in _populate
      setattr(self, name, value)
    File "C:\Python34\lib\site-packages\praw\objects.py", line 102, in __setattr__
      object.__setattr__(self, name, value)
  AttributeError: can't set attribute
  sys:1: ResourceWarning: unclosed &lt;socket object at 0x0342D930&gt;
  C:\Python34\lib\importlib\_bootstrap.py:2150: ImportWarning: sys.meta_path is empty
  </code></pre>
  
  <p>It no longer runs at all, anyone know how to fix this error?</p>