diff --git a/download_from_google_storage.py b/download_from_google_storage.py index 234f8d692..4d6266a23 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -21,6 +21,11 @@ import time import subprocess2 +# Env vars that tempdir can be gotten from; minimally, this +# needs to match python's tempfile module and match normal +# unix standards. +_TEMPDIR_ENV_VARS = ('TMPDIR', 'TEMP', 'TMP') + GSUTIL_DEFAULT_PATH = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'gsutil.py') # Maps sys.platform to what we actually want to call them. @@ -82,6 +87,9 @@ class Gsutil(object): env['AWS_CREDENTIAL_FILE'] = self.boto_path env['BOTO_CONFIG'] = self.boto_path + if PLATFORM_MAPPING[sys.platform] != 'win': + env.update((x, "/tmp") for x in _TEMPDIR_ENV_VARS) + return env def call(self, *args):