title: AttributeError: addinfourl instance has no __call__ method
body: <p>the first pass everything works fine, but the second run I get AttributeError: instance has no __ addinfourl call__ method, i don't know what's wrong</p>
  
  <p>first pass 
  True 
  Status:OK </p>
  
  <p>second pass File "D:\python\New Status\status.py", line 124, in  print mainstatus.bite() File "D:\python\New Status\status.py", line 109, in bite s = file("cc.beat") AttributeError: addinfourl instance has no call method</p>
  
  <p>basically use it to check the status of a server and confirm that another process is active</p>
  
  <pre><code>    failure = True
      servestatus = False
  
  
      def log():
          a=open ("Status.failures","a")
          now = datetime.now()
          tiempo = str (now) +"  -  Error\n"
          a.write(tiempo)
          a.close ()
  
      class mainstatus(object):
  
          @staticmethod
          def xmlstatus():
              try:        
                  file = urllib2.urlopen('http://192.168.1.110:9900/admin/xmlstatus?user=&amp;password=')
                  data = file.read()
                  file.close()
                  dom = parseString(data)
                  xmlTag = dom.getElementsByTagName('Status')[0].toxml()
                  xmlData=xmlTag.replace('&lt;Status&gt;','').replace('&lt;/Status&gt;','')
                  if xmlTag == "&lt;Status&gt;OK&lt;/Status&gt;":
                      stat = True
              except:
                  stat= False
              return stat
  
          @staticmethod
          def hola():
              x = "test"
              return x
  
          @staticmethod
          def internet(url):
              try:
                  response=urllib2.urlopen(url,timeout=1)
                  return True
              except urllib2.URLError as err: pass
              return False
  
          @staticmethod
          def heartbeat():
              a=open ("heart.beat","w")
              now = datetime.now()
              tiempo = str (now.minute)
              a.write(tiempo)
              a.close ()
  
          @staticmethod
          def push(mensaje):
              #Miguel
              conn = httplib.HTTPSConnection("api.pushover.net:443")
              conn.request("POST", "/1/messages.json",
                urllib.urlencode({
                  "token": "",
                  "user": "",
                  "message": mensaje,
                }), { "Content-type": "application/x-www-form-urlencoded" })
              conn.getresponse()
              #Gerswin
              conn = httplib.HTTPSConnection("api.pushover.net:443")
              conn.request("POST", "/1/messages.json",
                urllib.urlencode({
                  "token": "",
                  "user": "",
                  "message": mensaje,
                }), { "Content-type": "application/x-www-form-urlencoded" })
              conn.getresponse()
  
          @staticmethod
          def colam():
              cola = 0
              for root, dirs, files in os.walk("\\\\Server0\\smsdata\\Q"):
                      for file in files:    
                              if file.endswith('.req'):
                                      cola += 1
          @staticmethod
          def wol():
              HOST = "192.168.1.1"
              user = "root"
              password = "16745665"
              tn = telnetlib.Telnet(HOST)
              tn.read_until("login: ")
              tn.write(user + "\n")
              if password:
                  tn.read_until("Password: ")
                  tn.write(password + "\n")
              tn.write("/usr/sbin/wol -i 192.168.1.255 -p 7 00:11:25:36:08:FE\n")
              tn.write("exit\n")
              tn.read_all()
  
          @staticmethod
          def bite(): 
              now = datetime.now()
              tiempo = (now.minute)
              s = file("cc.beat")
              status = int(s.readline())
              s.close()
              vivo = tiempo - status    
              if (vivo &gt; 0):
                  return False
              else:
                  return True
  
      count = 5
      print "Server Status Check: Runing..."
  
      while (count &lt; 9):
  
          time.sleep(2)
          print mainstatus.bite()
          pulso = True
          if pulso == False:
              #os.startfile('check.exe')
              print "activa"
          else:
              pass
          status = mainstatus.internet("http://192.168.1.110:9900")
          mainstatus.heartbeat()
          if status == True:
            if   mainstatus.xmlstatus() == True:
                print '\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bStatus:OK',
  
                if failure == True:
                    accion = os.system('net stop "NowSMS"')
                    file = urllib2.urlopen('http://sql.gerswin.com/status.php?status=OK')
                    data = file.read()
                    file.close()
                    failure = False
  
                if mainstatus.colam() &gt;= 20 and servestatus == False:
                    accion = os.system('net start "NowSMS"')
                    mainstatus.push("Server Overload, Server 2 Running")
                    servestatus = True
                else:
                    if mainstatus.colam() &lt; 20 and servestatus == True:
                        mainstatus.push("Stoping Server 2")
                        accion = os.system('net stop "NowSMS"')
                        servestatus = False
                        file = urllib2.urlopen('http://sql.gerswin.com/status.php?status=OK')
                        data = file.read()
                        file.close()
  
            else:
                print '\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bStatus: Modem Failure',
                mainstatus.wol()        
                if servestatus == False:
                    accion = os.system('net start "NowSMS"')
                    mainstatus.push("Modem Failure, Server 2 Running")
                    log()
                    file = urllib2.urlopen('http://sql.gerswin.com/status.php?status=2')
                    data = file.read()
                    file.close()
                    servestatus = True
  
          else:
              print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bStatus: Fallo Server",
              mainstatus.wol()
              if servestatus == False:           
                  accion = os.system('net start "NowSMS"')
                  file = urllib2.urlopen('http://192.168.1.110:9900?ok=no')
                  data = file.read()
                  file.close()
                  log()
                  mainstatus.push("Server Failure, Server 2 Running")
                  servestatus = True
  </code></pre>