From d402e85d654b3e4506ee2e792182cc49ea457286 Mon Sep 17 00:00:00 2001 From: yiskylee Date: Fri, 23 May 2025 16:12:26 -0400 Subject: [PATCH] Update notebook_execution.py Currently when user needs to send out an email they need to store the attachment file in their home directory. However, in some cases the user does not own its home directory, using the default `mkdtemp` will ensure the user has the access to the created dir. --- notebooker/utils/notebook_execution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooker/utils/notebook_execution.py b/notebooker/utils/notebook_execution.py index 3b58398..2e271d8 100644 --- a/notebooker/utils/notebook_execution.py +++ b/notebooker/utils/notebook_execution.py @@ -27,7 +27,7 @@ def _send_email(from_email: str, to_email: str, result: Union[NotebookResultComp tmp_dir = None try: if isinstance(result, NotebookResultComplete): - tmp_dir = tempfile.mkdtemp(dir=os.path.expanduser("~")) + tmp_dir = tempfile.mkdtemp() # Attach PDF output to the email. Has to be saved to disk temporarily for the mail API to work. report_name = result.report_name.replace(os.sep, TEMPLATE_DIR_SEPARATOR) if isinstance(report_name, bytes):