From 9ec37636be8847c53f249ce42684aa0c57be6b78 Mon Sep 17 00:00:00 2001 From: Kieran O'Leary Date: Tue, 19 Aug 2025 11:06:07 +0100 Subject: [PATCH] Alternate method of making temp data folder to account for domain-joined windows accounts #193 --- bagit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bagit.py b/bagit.py index eab85d3..f841208 100755 --- a/bagit.py +++ b/bagit.py @@ -214,7 +214,8 @@ def make_bag( # FIXME: if we calculate full paths we won't need to deal with changing directories os.chdir(bag_dir) cwd = os.getcwd() - temp_data = tempfile.mkdtemp(dir=cwd) + temp_data = os.path.join(cwd, next(tempfile._get_candidate_names())) + os.mkdir(temp_data) for f in os.listdir("."): if os.path.abspath(f) == temp_data: