title: os.path.isdir returns false when folder exists?
body: <p>I have the following code which checks if the directory exists</p>
  
  <pre><code>def download(id, name, bar):
      cwd = os.getcwd()
      dir = os.path.join(cwd,bar)
      partial = os.path.join(cwd, id + ".partial")
      print os.path.isdir(dir)
      if(os.path.isdir(dir)):
          print "dir exists"
          dir_match_file(dir, bar)
      else:
          print dir
  </code></pre>
  
  <p>For a directory that actually exists, it returns "False". Here is the output:</p>
  
  <pre><code>False
  /scratch/rists/djiao/Pancancer/RNA-seq/CESC/TCGA-BI-A0VS-01A-11R-A10U-07
  </code></pre>
  
  <p>When I go to python interactive session and type in os.path.isdir("/scratch/rists/djiao/Pancancer/RNA-seq/CESC/TCGA-BI-A0VS-01A-11R-A10U-07"), it returns "true".</p>
  
  <p>Why does it say false when the folder exists?</p>