os.path.dirname(__file__) returns empty
<p>I want to get the path of current directory under which the .py file is executing.</p>

<p>A simple file "D:\test.py" with code:</p>

<pre><code>import os

print os.getcwd()
print os.path.basename(__file__)
print os.path.abspath(__file__)
print os.path.dirname(__file__)
</code></pre>

<p>It is wired that the output is:<br></p>

<blockquote>
  <p>D:\<br> test.py<br> D:\test.py<br> EMPTY<br></p>
</blockquote>

<p>I am expecting the same results from the getcwd() and path.dirname()</p>

<p>Given os.path.abspath = os.path.dirname + os.path.basename, why </p>

<pre><code>os.path.dirname(__file__)
</code></pre>

<p>returns empty?</p>
