Skip to content

copydir fails with TypeError: copy() got an unexpected keyword argument 'preserve_time' #90

Open
@iljau

Description

@iljau
import fs
import fs_s3fs
from fs import open_fs
from fs_s3fs import S3FS


def copy_to_latest():
    print(f"{fs.__version__=}")
    print(f"{fs_s3fs.__version__=}")

    target_fs: S3FS = open_fs(f's3://my-bucket/some/path/')
    print(f"{target_fs=}")

    src_path = "2022-06-27/08:05:10/"
    print(f"{src_path=}")

    dst_path = "latest"
    print(f"{dst_path=}")

    target_fs.copydir(
        src_path=src_path,
        dst_path=dst_path,
        create=True,
    )


if __name__ == "__main__":
    copy_to_latest()
fs.__version__='2.4.16'
fs_s3fs.__version__='1.1.1'
target_fs=[..]
src_path='2022-06-27/08:05:10/'
dst_path='latest'
Traceback (most recent call last):
  File "/[..]/copydir_bug.py", line 28, in <module>
    copy_to_latest()
  File "/[..]/copydir_bug.py", line 20, in copy_to_latest
    target_fs.copydir(
  File "/opt/venv/lib/python3.8/site-packages/fs/base.py", line 464, in copydir
    copy.copy_dir(self, src_path, self, dst_path, preserve_time=preserve_time)
  File "/opt/venv/lib/python3.8/site-packages/fs/copy.py", line 346, in copy_dir
    copy_dir_if(
  File "/opt/venv/lib/python3.8/site-packages/fs/copy.py", line 450, in copy_dir_if
    copier.copy(_src_fs, dir_path, _dst_fs, copy_path)
  File "/opt/venv/lib/python3.8/site-packages/fs/_bulk.py", line 144, in copy
    copy_file_internal(
  File "/opt/venv/lib/python3.8/site-packages/fs/copy.py", line 263, in copy_file_internal
    src_fs.copy(src_path, dst_path, overwrite=True, preserve_time=preserve_time)
TypeError: copy() got an unexpected keyword argument 'preserve_time'

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