Message246585
shutil.copytree behaves differently with symlinks depending on the 'symlinks' parameter. If this is True, symlinks are replicated in the destination. If False, the contents of the targets are copied to the destination.
With symlinks=False, it currently assumes that all symlinks are pointing to regular files. With a symlink to a directory, it tries to copy it using the file copy function, which fails with:
[Errno 21] Is a directory: '/tmp/tmpouavxt1u/link_to_dir'"
The attached patch adds an isdir() check to use copytree instead in that case. A test is also added. |
|
Date |
User |
Action |
Args |
2015-07-10 21:22:21 | takluyver | set | recipients:
+ takluyver |
2015-07-10 21:22:21 | takluyver | set | messageid: <1436563341.03.0.567959413242.issue24609@psf.upfronthosting.co.za> |
2015-07-10 21:22:20 | takluyver | link | issue24609 messages |
2015-07-10 21:22:20 | takluyver | create | |
|