Support copying files to a directory#3604
Conversation
|
Hi John. Thank you for the submission. In order to prevent future code modifications from causing regressions and breaking the behavior you are enabling here, could you add a test that ensures your target use case is covered? |
Since commit dbe0b11 the `copy()` function no longer supports copying files to a directory. The change in behaviour has lead to at least one regression[1]. This restore the previous behaviour. [1] getpelican#3442
|
Hi Justin I've added a test to cover copying a file to and existing directory. While creating the test I noticed a possible edge-case where if There is no equivalent at the OS level (because copying a file wouldn't automatically create any directories) so the expected behavior is probably undefined. I'm not sure if this is an edge case that is worth worrying about. |
This restores the ability for the
copy()function to copy files to a directory. The changes are essentially the same as what is used in the Python standard library.Pull Request Checklist
Resolves: #3442