title: path.exists() is returning False
body: <p>I'm building a basic file server and my program cannot find files. </p>
  
  <pre><code>def sendfile(sock, myfile):
      print 'Serving file:', myfile
      print 'File exists?:', os.path.exists(myfile)
  
      path = os.path.normpath(os.path.join(os.getcwd(), myfile))
      print 'Serving file:', path
      print 'File exists?:', os.path.exists(path)
  </code></pre>
  
  <p>These always return False even though the 'myfile' and 'path' are correct [the file is in the same directory as the server program]. </p>
  
  <p>IDLE works fine, but without passing to functions. </p>
  
  <pre><code>&gt;&gt;&gt; print os.path.exists("/user/server/foo.txt")  
  True
  </code></pre>
  
  <p>What have I missed?</p>
  
  <p>[EDIT:] Output:</p>
  
  <pre><code>Serving file: foo.txt
  
  File exists?: False
  Serving file: /user/server/foo.txt
  
  File exists?: False
  </code></pre>