title: Converting os.path to pathlib module no working out as expected
body: <p>Ive been trying to substitute the os.path with the new pathlib module. In these lines the os.path works every time with no error, while the Pathlib module brings the error:</p>
  
  <pre><code>Path' and 'str'
  [!] send_logs // Error.. ~ unsupported operand type(s) for +: 'PosixPath' and 'str'
  </code></pre>
  
  <p>The main purpose of this is to write a file to that folder; using Path.is_dir(log_dir) comes back True. Attempting this though through the pathlib module brings the error. Ive tried to locate other sources for an answer and came to the PosixPath as a separate variable to be used in expanduser; to no avail I am brought here </p>
  
  <p>Im sorry in advanced as i am novice and this is one of my first 'projects'! All the help is greatly appreciated. I have also come across similar questions but they were directed at finding the home dir, i.e Path.owner(Path.home())</p>
  
  <pre><code>#log_dir = os.path.expanduser('~') + '/Downloads/'   --- commented out for pathlib/path
  p = PosixPath('~' + '/Downloads/')
  log_dir = Path.expanduser(Path(p))
  </code></pre>
  
  <p>Thanks for the help that was given. Managed to get it to work with a single line: in the same manner as os.path.expanduser()</p>
  
  <pre><code>log_dir = str(PosixPath('~' + '/Downloads/').expanduser())
  </code></pre>