title: Python path.exists and path.join
body: <p>Python 2.7: 
  Struggling a little with path.exists</p>
  
  <pre><code>import os
  import platform
  OS = platform.system()
  CPU_ARCH = platform.machine()
  
  if os.path.exists( os.path.join("/dir/to/place/" , CPU_ARCH) ):
      print "WORKED"
      # Linux
      LD_LIBRARY_PATH = "/dir/to/place/" + CPU_ARCH
      TRANSCODER_DIR  = LD_LIBRARY_PATH + "/Resources/"
  else:
      print "FAILED"
      #fail back to original director if processor not recognised
      TRANSCODER_DIR  = "/dir/to/place/Resources/"
      LD_LIBRARY_PATH = "/dir/to/place"
  </code></pre>
  
  <p>As soon as I stick os.path.join with a variable inside it the if statement fails.</p>
  
  <pre><code>os.path.exists("/dir/to/place/arch")
  </code></pre>
  
  <p>returns TRUE</p>
  
  <pre><code>os.path.exists("/dir/to/place/" + CPU_ARCH)
  </code></pre>
  
  <p>returns FALSE</p>
  
  <p>I have tried many variations on the different path commands and to string commands none of them allow me to change this with a variable.</p>
  
  <pre><code>os.path.join("/dir/to/place/", CPU_ARCH)
  </code></pre>
  
  <p>returns /dir/to/place/arch</p>
  
  <p>it's not a permissions issues either full perms granted and I've tested using the python cli on it's own still the same issue.</p>
  
  <p>I've looked at all the stack posts for the same issue and the only response I've seen that someone says has worked is to strip the white space, I'm pretty new to python I don't see any whitespace on this.</p>