From c5200edf6efe36e625aaaffb4a148d1dd4b062b9 Mon Sep 17 00:00:00 2001 From: Eduardo Blancas Reyes Date: Fri, 11 Mar 2022 11:01:58 -0600 Subject: [PATCH] fixes win test --- src/ploomber/tasks/notebook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ploomber/tasks/notebook.py b/src/ploomber/tasks/notebook.py index cee85c4a9..7394b16b5 100644 --- a/src/ploomber/tasks/notebook.py +++ b/src/ploomber/tasks/notebook.py @@ -594,6 +594,10 @@ def run(self): finally: tmp.unlink() + # on windows, Path.rename will throw an error if the file exists + if path_to_out.is_file(): + path_to_out.unlink() + path_to_out_ipynb.rename(path_to_out) self._converter.convert()