diff --git a/grizzly/common/report.py b/grizzly/common/report.py index e2f6686a..3550424a 100644 --- a/grizzly/common/report.py +++ b/grizzly/common/report.py @@ -474,4 +474,5 @@ def tail(in_file: Path, size_limit: int) -> None: out_fp.write(b"[LOG TAILED]\n") copyfileobj(in_fp, out_fp, 0x10000) # 64KB chunks in_file.unlink() - move(out_file, in_file) + # Python 3.9+: move() accepts a path-like object for both src and dst + move(out_file, str(in_file.resolve())) diff --git a/grizzly/common/reporter.py b/grizzly/common/reporter.py index c917be55..f7c2d37e 100644 --- a/grizzly/common/reporter.py +++ b/grizzly/common/reporter.py @@ -170,7 +170,8 @@ def _submit_report( log_path = dest / f"{self.report_prefix}_logs" if log_path.is_dir(): LOG.warning("Report log path exists '%s'", log_path) - move(report.path, log_path) + # Python 3.9+: move() accepts a path-like object for both src and dst + move(str(report.path.resolve()), str(log_path.resolve())) # avoid filling the disk free_space = disk_usage(str(log_path.resolve())).free if free_space < self.min_space: diff --git a/grizzly/common/storage.py b/grizzly/common/storage.py index 07e5423a..f1168a7c 100644 --- a/grizzly/common/storage.py +++ b/grizzly/common/storage.py @@ -203,7 +203,8 @@ def add_from_file( if copy: copyfile(src_file, dst_file) else: - move(src_file, dst_file) + # Python 3.9+: move() accepts a path-like object for both src and dst + move(str(src_file.resolve()), str(dst_file.resolve())) # entry_point is always 'required' if required or url_path == self.entry_point: diff --git a/grizzly/target/assets.py b/grizzly/target/assets.py index 026de2d6..9c57688c 100644 --- a/grizzly/target/assets.py +++ b/grizzly/target/assets.py @@ -59,8 +59,8 @@ def add(self, asset: str, path: Path, copy: bool = True) -> Path: else: copytree(path, dst) else: - # TODO: move() only accepts str in Python 3.8 - move(str(path), str(self.path)) + # Python 3.9+: move() accepts a path-like object for both src and dst + move(str(path.resolve()), str(self.path.resolve())) self.assets[asset] = path.name LOG.debug("%s asset %r to '%s'", "copied" if copy else "moved", asset, dst) return dst