Skip to content

Commit b6cfa3e

Browse files
committed
temp_dir fix
1 parent 39cea8b commit b6cfa3e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mergin/client_pull.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def download_project_async(mc, project_path, directory, project_version=None):
145145
mp.log.info("--- version: " + mc.user_agent_info())
146146
mp.log.info(f"--- start download {project_path}")
147147

148-
tmp_dir = tempfile.TemporaryDirectory(prefix="python-api-client-", ignore_cleanup_errors=True, delete=True)
148+
tmp_dir = tempfile.TemporaryDirectory(prefix="python-api-client-")
149149

150150
try:
151151
# check whether we download the latest version or not
@@ -424,7 +424,7 @@ def pull_project_async(mc, directory) -> PullJob:
424424
# then we just download the whole file
425425
_pulling_file_with_diffs = lambda f: "diffs" in f and len(f["diffs"]) != 0
426426

427-
tmp_dir = tempfile.TemporaryDirectory(prefix="mm-pull-", ignore_cleanup_errors=True, delete=True)
427+
tmp_dir = tempfile.TemporaryDirectory(prefix="mm-pull-")
428428
pull_changes = mp.get_pull_changes(server_info["files"])
429429
mp.log.debug("pull changes:\n" + pprint.pformat(pull_changes))
430430
fetch_files = []

mergin/client_push.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def push_project_async(mc, directory) -> Optional[UploadJob]:
297297
return
298298

299299
mp.log.debug("push changes:\n" + pprint.pformat(changes))
300-
tmp_dir = tempfile.TemporaryDirectory(prefix="python-api-client-", ignore_cleanup_errors=True, delete=True)
300+
tmp_dir = tempfile.TemporaryDirectory(prefix="python-api-client-")
301301

302302
# If there are any versioned files (aka .gpkg) that are not updated through a diff,
303303
# we need to make a temporary copy somewhere to be sure that we are uploading full content.

mergin/test/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3155,7 +3155,7 @@ def test_client_pull_project_async(mc):
31553155
pull_project_wait(job)
31563156
assert job.total_size == job.transferred_size
31573157
pull_project_finalize(job)
3158-
assert not os.path.exists(job.temp_dir)
3158+
assert not os.path.exists(job.tmp_dir.name)
31593159

31603160

31613161
def test_client_project_sync(mc):

0 commit comments

Comments
 (0)