()
| 178 | def safe_copy(source, dest, overwrite=False): |
| 179 | # type: (Text, Text, bool) -> None |
| 180 | def do_copy(): |
| 181 | # type: () -> None |
| 182 | temp_dest = dest + uuid4().hex |
| 183 | shutil.copy(source, temp_dest) |
| 184 | safe_rename(temp_dest, dest) |
| 185 | |
| 186 | # If the platform supports hard-linking, use that and fall back to copying. |
| 187 | # Windows does not support hard-linking. |
no test coverage detected