Skip to content

Copying a list of files from different directories gives (possibly) wrong result #1234

@ianthomas23

Description

@ianthomas23

Another discrepancy that has arisen from #1226 and related work.

cp(["source/file1", "source/subdir/subfile2"], "target/")

gives target/file1 and target/subdir/subfile2, i.e. it keeps the relative directory structure of the source files.

The command-line equivalent gives

$ cp source/file1 source/subdir/subfile2 target/
$ tree target
target
├── file1
└── subfile2

so that source files are all copied into the target directory.

For consistency I lean towards doing the same as command-line copy, but I suspect that this was a specific design decision and a substantial amount of work has gone into making the behaviour as it currently is.

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