title: Convert Windows relative path to POSIX relative path so I can join POSIX absolute path and Windows relative path
body: <p>I'm looking for a platform-independent solution. Everything works on Linux because <code>os.walk</code> already returns POSIX paths. However, if I'm on Windows I might get the following two paths:</p>
  
  <pre><code>abspath = "/x/y/z" # given path for a remote server which uses POSIX paths
  relpath = "a\\b\\c" # acquired from local file system via os.walk, so it uses slash or backslash depending on the platform
  </code></pre>
  
  <p>The desired result of the joined path for this example would be:</p>
  
  <pre><code>'/x/y/z/a/b/c'
  </code></pre>
  
  <p>However, naturally, using <code>posixpath.join</code> results in:</p>
  
  <pre><code>&gt;&gt;&gt; posixpath.join(abspath, relpath)
  '/x/y/z/a\\b\\c'
  </code></pre>
  
  <p>So when I'm on Windows and have a relative path like <code>a\\b\\c</code>, I think it might make sense to convert it to a POSIX relative path <code>a/b/c</code> first, so I am able to use <code>posixpath.join</code> afterwards?</p>
  
  <p>However, I don't believe simply replacing every backslash with a slash is best practice - or is it? I couldn't find any function which provides such a conversion.</p>