title: Misunderstanding of python os.path.abspath
body: <p>I have following code:</p>
  
  <pre><code>directory = r'D:\images'
  for file in os.listdir(directory):
      print(os.path.abspath(file))
  </code></pre>
  
  <p>and I want next output:</p>
  
  <ul>
  <li>D:\images\img1.jpg</li>
  <li>D:\images\img2.jpg and so on </li>
  </ul>
  
  <p>But I get different result:</p>
  
  <ul>
  <li>D:\code\img1.jpg</li>
  <li>D:\code\img2.jpg</li>
  </ul>
  
  <p>where D:\code is my current working directory and this result is the same as</p>
  
  <pre><code>os.path.normpath(os.path.join(os.getcwd(), file))
  </code></pre>
  
  <p>So, the question is: What is the purpose of os.path.abspath while I must use</p>
  
  <pre><code>os.path.normpath(os.path.join(directory, file))
  </code></pre>
  
  <p>to get REAL absolute path of my file? Show real use-cases if possible.</p>