title: python os.path.realpath not working properly
body: <p>I have following code:</p>
  
  <pre><code>os.chdir(os.path.dirname(os.path.realpath(__file__)) + "/../test")
  path.append(os.getcwd())
  os.chdir(os.path.dirname(os.path.realpath(__file__)))
  </code></pre>
  
  <p>Which should add <code>/../test</code> to python path, and it does so, and it all runs smoothly afterwards on eclipse using PyDev. </p>
  
  <p>But when I lunch same app from console second os.chdir does something wrong, actually the wrong thing is in <code>os.path.realpath(__file__)</code> cus it returns <code>../test/myFile.py</code> in stead of <code>../originalFolder/myFile.py</code>. Of course I can fix this by using fixed <code>os.chdir("../originalFolder")</code> but that seems a bit wrong to me, but this works on both, eclipse and console.</p>
  
  <p>P.S. I'm using <code>os.getcwd()</code> actually because I want to make sure there isn't such folder already added, otherwise I wouldn't have to switch dir's at all </p>
  
  <p>So is there anything wrong with my approach or I have messed something up? or what? :)</p>
  
  <p>Thanks in advance! :)</p>