Skip to content

mv('filepath','filepath') results in deletion of the file rather than no action/inplace move  #711

@NadimNadimNadimNadimNadim

Description

Calling mv() of s3fs.S3FileSystem with path1==path2 results in deletion. This is not the expected behavior, as a POSIX mv results in a message saying they are the same file, and in particular does not result in deletion.

Working example:

session = aiobotocore.session.AioSession(profile="dev")
s3 = s3fs.S3FileSystem(session=session)
path_to_file = 'mybucket/file.txt'
s3.mv(
        path1=path_to_file
        path2=path_to_file
)

Now, the file in my bucket at location path_to_file is deleted.
I have versioning enabled on my bucket for what its worth, so I see the delete marker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions