title: Joining: string and absolute path with os.path
body: <p>Why is this not working, what am I doing wrong?</p>
  
  <pre><code>&gt;&gt;&gt; p1 = r'\foo\bar.txt'
  &gt;&gt;&gt; os.path.join('foo1', 'foo2', os.path.normpath(p1))
  '\\foo\\bar.txt'
  </code></pre>
  
  <p>I expected this:</p>
  
  <pre><code>'foo1\\foo2\\foo\\bar.txt'
  </code></pre>
  
  <p>Edit:</p>
  
  <h1>A Solution</h1>
  
  <pre><code>&gt;&gt;&gt; p1 = r'\foo\bar.txt'
  &gt;&gt;&gt; p1 = p1.strip('\\') # Strip '\\' so the path would not be absolute 
  &gt;&gt;&gt; os.path.join('foo1', 'foo2', os.path.normpath(p1))
  'foo1\\foo2\\foo\\bar.txt'
  </code></pre>