title: Program does not exit. How to find out what python is doing?
body: <p>I have a python script which is working fine so far. However, my program does not exit properly. I can debug until and I'm returning to the end, but the programm keeps running.</p>
  
  <p>main.main() does a lot of stuff: it downloads (http, ftp, sftp, ...) some csv files from a data provider, converts the data into a standardized file format and loads everyting into the database. </p>
  
  <p>This works fine. However, the program does not exit. How can I find out, where the programm is "waiting"?
  There exist more than one provider - the script terminates correctly for all providers except for one (sftp download, I'm using paramiko)</p>
  
  <pre class="lang-py prettyprint-override"><code>if __name__ == "__main__":
  
      main.log = main.log2both
      filestoconvert = []
      #filestoconvert = glob.glob(r'C:\Data\Feed\ProviderName\download\*.csv')
      main.main(['ProviderName'], ['download', 'convert', 'load'], filestoconvert)
  </code></pre>
  
  <p>I'm happy for any thoughts and ideas!</p>