title: Unsupported operand type(s) for +: 'WindowsPath' and 'str'
body: <p>The code I'm working on throws the error <code>Unsupported operand type(s) for +: 'WindowsPath' and 'str'</code>. I have tried many things, and none have fixed this (aside from removing the line with the error, but that's not helpful).</p>
  <p>For context, this script (when it's done) is supposed to:</p>
  <ol>
  <li>Find a file (mp3) based on the ID you type in (in the directory specified in SongsPath.txt)</li>
  <li>Back it up</li>
  <li>Then replace it with another file (renamed to the previous file's name)</li>
  </ol>
  <p>so that the program that fetches these files plays the new song instead of the old one, but can be restored to the original song at any time. (the songs are downloaded from newgrounds and saved by their newgrounds audio portal ID)</p>
  <p>I'm using Python 3.6.5</p>
  <pre><code>import os
  import pathlib
  from pathlib import Path
  
  nspt = open (&quot;NewSongsPath.txt&quot;, &quot;rt&quot;)
  nsp = Path (nspt.read())
  spt = open(&quot;SongsPath.txt&quot;, &quot;rt&quot;)
  sp = (Path(spt.read()))
  print(&quot;type the song ID:&quot;)
  ID = input()
  csp = str(path sp + &quot;/&quot; + ID + &quot;.mp3&quot;) # this is the line throwing the error.
  sr = open(csp , &quot;rb&quot;)
  sw = open(csp, &quot;wb&quot;)
  print (sr.read())
  </code></pre>