From 67570a436802d79ad86c8d5b868f89e38e4781ef Mon Sep 17 00:00:00 2001 From: Darryl Nixon Date: Sun, 16 Jul 2023 11:39:16 -0700 Subject: [PATCH] Unlink Path object instead of Shred*, oops --- melamine/classes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/melamine/classes.py b/melamine/classes.py index e6b62eb..03fb411 100644 --- a/melamine/classes.py +++ b/melamine/classes.py @@ -84,7 +84,7 @@ class ShredFile(AsyncObject): """Class for tracking each file to be shredded.""" async def __init__(self, path: Path) -> None: - self.absolute_path = path.resolve() + self.absolute_path = path.resolve().absolute() self.byte_size = path.stat().st_size self.mount_point = find_mount(self.absolute_path) self.fs_handler = await mount_to_fs_handler(self.mount_point) @@ -137,7 +137,7 @@ class ShredFile(AsyncObject): # Remove the file log_buf = f"[4/4] Unlinking {self.absolute_path}" if not dryrun: - await file.unlink() + self.absolute_path.unlink() else: log_buf = "DRY RUN (no changes made) " + log_buf logger.info(log_buf)