Description
I am currently working on integrating OPERA DISP-S1 product downloads into an ArcGIS Toolbox workflow and encountered a download issue when running opera-utils on Windows.
During the DISP-S1 download step, the process fails with a permission-related error associated with the temporary NetCDF file handling.
Location of issue
The issue appears to originate from:
src/opera_utils/disp/_download.py
specifically:
with tempfile.NamedTemporaryFile(suffix=".nc") as tf:
Proposed fix
Changing the temporary file creation to:
with tempfile.NamedTemporaryFile(
suffix=".nc",
delete=True,
delete_on_close=False
) as tf:
resolves the issue and allows the DISP-S1 download workflow to complete successfully on Windows.
This appears to be related to how Windows handles access to open named temporary files, where the file cannot always be reopened by another process while the original handle remains active.
Would it be possible to integrate this change (or a similar Windows-compatible temporary file handling approach) into opera-utils so the fix becomes available through the PyPI/conda-forge releases?
This would allow downstream tools, including ArcGIS Toolbox integrations, to use the standard packaged version of opera-utils without requiring local modifications.
Thank you for maintaining this package.
Description
I am currently working on integrating OPERA DISP-S1 product downloads into an ArcGIS Toolbox workflow and encountered a download issue when running opera-utils on Windows.
During the DISP-S1 download step, the process fails with a permission-related error associated with the temporary NetCDF file handling.
Location of issue
The issue appears to originate from:
src/opera_utils/disp/_download.py
specifically:
with tempfile.NamedTemporaryFile(suffix=".nc") as tf:
Proposed fix
Changing the temporary file creation to:
with tempfile.NamedTemporaryFile(
suffix=".nc",
delete=True,
delete_on_close=False
) as tf:
resolves the issue and allows the DISP-S1 download workflow to complete successfully on Windows.
This appears to be related to how Windows handles access to open named temporary files, where the file cannot always be reopened by another process while the original handle remains active.
Would it be possible to integrate this change (or a similar Windows-compatible temporary file handling approach) into opera-utils so the fix becomes available through the PyPI/conda-forge releases?
This would allow downstream tools, including ArcGIS Toolbox integrations, to use the standard packaged version of opera-utils without requiring local modifications.
Thank you for maintaining this package.