title: os.path.exists Returns False w/ Escaped Paths Including Spaces
body: <p>I've run across a seemingly strange issue in Python and all the Googling in the world hasn't helped. I'm trying to simply check whether or not a path exists in Python. The code below returns expected results with paths that do not have spaces, but as soon as there's a folder with a space, it no longer works.</p>
  
  <pre><code>import os
  
  temp = "~/Documents/Example File Path/"
  temp = temp.strip('\n')
  tempexpanded = os.path.expanduser(temp)
  tempesc = tempexpanded.replace(" ", "\\ ")
  if not os.path.exists(tempesc):
      print "Path does not exist"
  else:
      print "Path exists"
  </code></pre>
  
  <p>For some reason, this results in printing "Path does not exist", even though the following works if I type it into the terminal:</p>
  
  <pre><code>cd /Users/jmoore/Documents/Example\ File\ Path/
  </code></pre>
  
  <p>When I breakpoint my code, tempesc has a value of: </p>
  
  <blockquote>
    <p>/Users/jmoore/Documents/Example\\ File\\ Path/</p>
  </blockquote>
  
  <p>Given that, I'm not sure where I'm going wrong here? Any help is appreciated.</p>