title: python: 'str' object is not callable?
body: <p>I have gone through many similar posts here and there but non of them seem solve my problem. I have a method that searches for file path:</p>
  
  <pre><code>def getDumpFile(self):
          self.saveDump()
          dumpname = str(self.filename)+'-01.netxml'
  
          filepath = os.path.join('/some/path/to/file',dumpname)
          try:
              if os.path.exists(os.path.join('/some/path/to/file',dumpname)):
                  logging.debug( "Filepath "+str(filepath) )
                  return filepath
              else:
                  logging.debug( "File Not Found" )
                  return None
          except OSError as e:
              logging.debug( "File not created: "+str(e) )
              return None
  </code></pre>
  
  <p>and in the main function I call this function like this:</p>
  
  <pre><code>xmlfile = wscanner.getDumpFile()
  </code></pre>
  
  <p>and when I execute above code, it finds the correct path in <code>getDumpFile()</code> method but the server gives out exception:</p>
  
  <pre><code>Unexpected exception in wireless.views.attackAP with type &lt;type 'exceptions.TypeError'&gt; and error 'str' object is not callable
  </code></pre>
  
  <p>I really don't know why passing the <code>filepath</code> to <code>xmlfile</code> variable(which I believe is never initiated before)could cause error,please help. Thanks.</p>
  
  <p>Edit: It is actually the code <code>xmlfile = wscanner.getDumpFile()</code> that gives out error, but I don't know why. Comment out this line would get rid of the error, but I need this path later on.</p>