I was trying to use the put() method when working on the Snakemake Pelican storage plugin to copy a local file to the remote Pelican path.
In this case, I created the Pelican filesystem and did something like:
pelfs.put("/some/local/path/to/file.txt", "pelican://osg-htc.org/some/namespace/path/file.txt")
My intention was to put the local file.txt under the remote namespace as file.txt.
However, this kept putting the file under the namespace as /some/namespace/path/file.txt/file.txt. I re-ran with some debugging enabled and noticed that PelicanFS's isdir() method was improperly determining that /some/namespace/path/file.txt should be treated as a remote directory, despite that path not existing at the Origin. Because of this, it was appending the local filename to the remote path, resulting in the duplication.
I worked around this by using put_file() instead of put().