Skip to content

Commit 5c2deec

Browse files
Fix windows permission error when dumping model file (#501)
1 parent 84f6896 commit 5c2deec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

linopy/remote/oetc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,12 @@ def solve_on_oetc(self, model): # type: ignore
495495
"""
496496
try:
497497
# Save model to temporary file and upload
498+
model_dump_path = None
498499
with tempfile.NamedTemporaryFile(prefix="linopy-", suffix=".nc") as fn:
499-
model.to_netcdf(fn.name)
500-
input_file_name = self._upload_file_to_gcp(fn.name)
500+
model_dump_path = fn.name
501+
502+
model.to_netcdf(model_dump_path)
503+
input_file_name = self._upload_file_to_gcp(fn.name)
501504

502505
# Submit job and wait for completion
503506
job_uuid = self._submit_job_to_compute_service(input_file_name)

0 commit comments

Comments
 (0)