diff --git a/bin/generate.py b/bin/generate.py index 0460ef02..56db11f7 100644 --- a/bin/generate.py +++ b/bin/generate.py @@ -1566,14 +1566,10 @@ def generate_copies_and_includes(d): def remove(self, src): if self.trashdir is None: self.trashdir = self.problem.tmpdir / secrets.token_hex(4) - assert src.is_relative_to(self.problem.path / 'data') - dst = self.trashdir / src.relative_to((self.problem.path / 'data')) + dst = self.trashdir / src.absolute().relative_to((self.problem.path / 'data').absolute()) dst.parent.mkdir(parents=True, exist_ok=True) - def copy(src, dst): - shutil.copy2(src, dst, follow_symlinks=False) - - shutil.move(src, dst, copy) + shutil.move(src, dst) def _remove_unknown(self, path, bar, silent=False): local = path.relative_to(self.problem.path / 'data')