-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prepare temporary directory when fget_object
#1309
Conversation
minio/api.py
Outdated
@@ -1044,6 +1044,7 @@ def fget_object(self, bucket_name, object_name, file_path, | |||
|
|||
# Write to a temporary file "file_path.part.minio" before saving. | |||
tmp_file_path = tmp_file_path or f"{file_path}.{stat.etag}.part.minio" | |||
makedirs(os.path.dirname(tmp_file_path)) # prepare temporary file's directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a good idea SDK to create entire directory tree. It is user's responsibility to have correct file_path
. BTW this is not temporary directory rather minio-py
creates temporary file under the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send a fix to sanitize etag
here using helpers.queryencode()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Fix CI failure |
if `stat.etag` contains `/`, will cause exception that `fget_object` try to write to a non-exists directory
done |
fget_object
got exception when download temporary file in a non-exists directory.