Skip to content

Commit

Permalink
Change how tempdir works on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jul 26, 2024
1 parent 8d38759 commit ecbdb40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/zampy/datasets/fapar_lai.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Implementation of the FAPAR LAI dataset."""

import os
import shutil
import tempfile
import zipfile
Expand Down Expand Up @@ -119,7 +120,10 @@ def ingest(

# netCDF files follow CF-1.6, only unpacking the archives is required.
for file in zip_files:
with tempfile.TemporaryDirectory(dir=tmp_path) as _tmpdir:
with tempfile.TemporaryDirectory(
dir=tmp_path,
ignore_cleanup_errors=True if os.name == "nt" else False,
) as _tmpdir:
tmpdir = Path(_tmpdir)

extract_fapar_zip(
Expand Down

0 comments on commit ecbdb40

Please sign in to comment.