-
Notifications
You must be signed in to change notification settings - Fork 329
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
Use hex instead of hash interface in partMetadata #531
Conversation
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.
This a good change tested. LGTM
minio/api.py
Outdated
@@ -1558,7 +1559,7 @@ def _do_put_multipart_object(self, bucket_name, object_name, part_metadata, | |||
|
|||
headers = { | |||
'Content-Length': part_metadata.size, | |||
'Content-Md5': part_metadata.md5hasher.base64digest() | |||
'Content-Md5': base64.b64encode(part_metadata.md5_hex.decode("hex")) |
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.
For python3 , this does not work - I get an AttributeError: 'str' object has no attribute 'decode' part_metadata.md5_hex is of type string.
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.
For python3 , this does not work - I get an AttributeError: 'str' object has no attribute 'decode' part_metadata.md5_hex is of type string.
Weird, I didn't get any error when I tested python3 examples/fput_object.py
, can you tell me how did you test exactly ?
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.
The error happens if you run python3 fput_object.py, i.e. by moving the fput_object.py from examples/ folder to the main repo 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.
Basically this would import your current code @vadmeste
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.
@poornas, the issue is fixed, can you check/review again ?
It would be little easier to use hex directly to express a part's md5 or sha256 sum instead of hash interface. Convert hex to base64 whenever we need that.
5172886
to
4aebebd
Compare
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.
Looks good - tested with python3
@harshavardhana can you review this again and merge? |
It would be little easier to use hex directly to express
a part's md5 or sha256 sum instead of hash interface. Convert
hex to base64 whenever we need that.