You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the machine in which the upload happens, downloading works fine. However, when a different machine tries to download the S3 remote path, it downloads files as directory.
frompathlibimportPathfromcloudpathlibimportCloudPathCWD=Path.cwd()
TMP=Path(tempfile.gettempdir())
remote_path=CloudPath(f's3://test/models/')
local_path=CWD/'models/'remote_path.upload_from(local_path)
forrpinremote_path.iterdir():
lp=local_path/rp.relative_to(remote_path)
assertrp.is_file() ==lp.is_file(), f'The {rp} remote path must be a file!'assertrp.is_dir() ==lp.is_dir(), f'The {rp} remote path must be a directory!'local_path=TMP/'models'remote_path.download_to(local_path)
forrpinremote_path.iterdir():
lp=local_path/rp.relative_to(remote_path)
assertrp.is_file() ==lp.is_file(), f'The {lp} local path must be a file!'assertrp.is_dir() ==lp.is_dir(), f'The {lp} local path must be a directory!'
The text was updated successfully, but these errors were encountered:
adrianohrl
changed the title
download_to from S3 is
Downloading files as directory from S3
Jan 3, 2023
@adrianohrl Sounds like the IAM had list permissions, but not some other permission (like GetObject or GetObjectAttributes). Do you know which ones you missing? That will be helpful.
We'll need to double check, but I think you may get a 403 both in the case that you do no have permissions for head_object and in the case that the object does not exist, which may complicate a fix here. If so, we may consider doing both a list check and then a get check on instantiation to ensure the user has the requisite permissions.
pjbull
changed the title
Downloading files as directory from S3
For users missing certain S3 permissions, files may be identified as directories
Jan 3, 2023
Depending on the machine in which the upload happens, downloading works fine. However, when a different machine tries to download the S3 remote path, it downloads files as directory.
The text was updated successfully, but these errors were encountered: