From 7432115385ea9f0cb25c1c0cd15612bba9d9c503 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Thu, 20 Jun 2024 19:47:20 +0200 Subject: [PATCH] use pathlib --- scripts/disembed-figures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/disembed-figures.py b/scripts/disembed-figures.py index 611c8ad8..67c20f30 100644 --- a/scripts/disembed-figures.py +++ b/scripts/disembed-figures.py @@ -17,8 +17,7 @@ def main(paths: list[Path]) -> None: f"(attachment:{name})", f"({name})" ) for _, encoded in data.items(): - with open(f"{name}", "wb") as f: - f.write(base64.b64decode(encoded)) + Path(name).write_bytes(base64.b64decode(encoded)) if write: nbformat.write(notebook, path)