title: Python bootstrap threading error on remote host only
body: <p>I have been running a script that contains three threads; </p>
  
  <p>The main thread handles IRC messages, the second is a thread that containing a socket server that sends strings from IRC to a flash display when it connects as a client and the third is a socket server that sends the policy file which is a flash requirement when the client connects.</p>
  
  <p>The python file runs fine my on "localhost", but when I host it on my linode it recieves the the first string only and sends the string response that is displayed on flash before crashing with the following error message.</p>
  
  <p>The following error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "/opt/python3.3/lib/python3.3/threading.py", line 616, in _bootstrap
      self._bootstrap_inner()
    File "/opt/python3.3/lib/python3.3/threading.py", line 682, in _bootstrap_inner
      self._stop()
  TypeError: 'Event' object is not callable
  </code></pre>
  
  <p>Here is my socket server code:</p>
  
  <pre><code>class FlashSOCKET (threading.Thread):
      def __init__(self, threadID, name, counter):
          threading.Thread.__init__(self)
          self.threadID = threadID
          self.name = name
          self.counter = counter
          self._stop = threading.Event()
          self.stopWaitLoop = False
          self.conn = None
          self.addr = None
          self.HOST = None
          self.PORT = 7001
          self.s = None
  
      def run(self):
          global running, toSend, message
          print ("Starting " + self.name)
          while running:
              self.startListening()
              while running:
                  if (messageDeque):
                      try:
                          print(self.conn.recv(1024))
                          self.conn.send(messageDeque.popleft().encode('utf8'))
                          print (messageDeque)
                          break
                      except:
                          pass # Nothing to do keep listening
  
              if (self.conn != None):
                  self.close_connection()
          if (self.conn != None):
              self.close_connection()
  
          print ("Exiting " + self.name)
  
      def startListening(self):
          global running, message, toSend
          print ("starting to listen")
          for res in socket.getaddrinfo(self.HOST, self.PORT, socket.AF_UNSPEC,
                                        socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
              af, socktype, proto, canonname, sa = res
              try:
                  self.s = socket.socket(af, socktype, proto)
                  self.s.settimeout(0.5)
              except socket.error as msg:
                  self.s = None
                  continue
              try:
                  self.s.bind(sa)
                  self.s.listen(1)
  
              except socket.error as msg:
                  print ("socket error")
                  self.s.close()
                  self.s = None
                  continue
              break
          if self.s is None:
              print ('could not open socket')
              sys.exit(1)
          while(running):
              try:
                  self.conn, self.addr = self.s.accept()
                  time.sleep(1)
                  break
              except:
                  continue
          print ('Connected by', self.addr)
  
      def close_connection(self):
          self.conn.close()
          print ("connection closed")
  </code></pre>
  
  <p>Running is a global bool flag variable that let me stop the program when I need to.
  The messageDeque is a deque buffer that gets filled with strings in the main thread when people talk in IRC. </p>
  
  <p>I think, toSend and message are bits of redundant code.</p>