title: os.path.isfile() doesn't work. Why?
body: <p>I'm trying to do this:</p>
  
  <pre><code>import os
  [x for x in os.listdir('.') if os.path.isfile(x)]
  [x for x in os.listdir('dirname') if os.path.isfile(x)]
  [x for x in os.listdir(os.path.abspath('dirname')) if os.path.isfile(os.path.abspath(x))] 
  </code></pre>
  
  <p>The first line works:</p>
  
  <pre><code>[x for x in os.listdir('.') if os.path.isfile(x)]
  </code></pre>
  
  <p>But the next two:</p>
  
  <pre><code>[x for x in os.listdir('dirname') if os.path.isfile(x)]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[x for x in os.listdir(os.path.abspath('dirname')) if os.path.isfile(os.path.abspath(x))] 
  </code></pre>
  
  <p>just output <code>[]</code></p>
  
  <p>Why?</p>