Skip to content

Commit 6e1924f

Browse files
saimanikantFedericoNegri
authored andcommitted
Fix data transfer failure while running Tox on Windows (#648)
1 parent ab7a9bb commit 6e1924f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ansys/hps/client/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import logging
2727
import os
2828
import platform
29+
import tempfile
2930
import warnings
3031

3132
import jwt
@@ -317,6 +318,15 @@ def _get_download_dir(self):
317318
company_folder = ".ansys"
318319

319320
home_path = os.environ.get(environment_variable, None)
321+
if home_path is None:
322+
# Fallback to the temporary directory
323+
log.error(
324+
f"Environment variable {environment_variable} is not set. "
325+
"Falling back to temporary directory."
326+
)
327+
home_path = tempfile.gettempdir()
328+
329+
log.info(f"Using temporary directory {home_path} for data transfer binaries.")
320330

321331
return os.path.join(home_path, company_folder, "hps", "data-transfer", "binaries")
322332

0 commit comments

Comments
 (0)