Python path as a string
Python path as a string
filename
has a method called abspath that returns an object with the absolute path. You can cast that to a string.
...
folder_path = path(~/folder/)
filename = path.joinpath(foo)
f = sftp.open(str(filename), r)