title: Python Error : TypeError: can only concatenate list (not "str") to list
body: <p>I am currently working on a backup program, I have run into errors while trying to gernate a unique file name with a given destination. I call this function in my code as: getFileUnique(f,pathtofile(backup+"/"+"../trash/")). f is the file path, the rest of the variables are pretty straight forward.</p>
  
  <pre><code>def getFileUnique(path,destination):
      path = path.replace("\\","/")
      p = path.split("/")[-1]
      if not os.path.exists(join(destination,p)):
          return destination+p
      j = p.split(".")
      counter = 0
      print(j)
      while os.path.exists(join(destination,j[:-1]+str(counter)+"."+j[-1])):
          print(counter)
          print("asdfsdf")
          counter += 1
      return destination+j[:-1]+str(counter)+"."+j[-1]
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Owner\Google Drive\Programs\Dev Enviroment\python\backup\backup.py", line 76, in &lt;module&gt;
      main("files","backup")
    File "C:\Users\Owner\Google Drive\Programs\Dev Enviroment\python\backup\backup.py", line 73, in main
      updateBackup(oldf,newf,reg,backup)
    File "C:\Users\Owner\Google Drive\Programs\Dev Enviroment\python\backup\backup.py", line 65, in updateBackup
      k = getFileUnique(f,pathtofile(backup+"/"+"../trash/"))
    File "C:\Users\Owner\Google Drive\Programs\Dev Enviroment\python\backup\backup.py", line 41, in getFileUnique
      while os.path.exists(join(destination,j[:-1]+str(counter)+"."+j[-1])):
  TypeError: can only concatenate list (not "str") to list
  </code></pre>