-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Print out MD5, but get a byte array. #13104
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. |
More specific configuration: |
Hi @likun47 Thanks for reaching out! We will discuss this and get back to you! |
Hi @likun47 We know it's weird, sorry about that... While we had a discussion and currently we don't plan to make it to a str since it's a breaking change to other customers. Sorry again about the inconvenience. Let me know if you have any concern.... |
Hi Xiaoxi,
Thank you for this work around. We already used the method you provided
above to fix the problem.
We appreciate your help.
…On Thu, Aug 20, 2020 at 9:35 PM Xiaoxi Fu ***@***.***> wrote:
Hi @likun47 <https://github.com/likun47>
We know it's weird, sorry about that... While we had a discussion and
currently we don't plan to make it to a str since it's a breaking change to
other customers.
So currently you can do base64 encode the bytes and utf-8 decode it like
this:
encode_base64(content_md5).decode('utf-8')
Sorry again about the inconvenience. Let me know if you have any
concern....
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13104 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADRMMC7OIQUNHPXRAPMQ3H3SBX2SZANCNFSM4P6W67QA>
.
|
Hi @likun47 we will proceed to close this issue since it looks like it is resolved on your end, if anything else comes up feel free to reach out :) |
add cosmosdb python track2 pipeline (Azure#13104) * add cosmosdb python track2 pipeline * fix duplication error
* CodeGen from PR 13104 in Azure/azure-rest-api-specs add cosmosdb python track2 pipeline (#13104) * add cosmosdb python track2 pipeline * fix duplication error * test,version,CHANGELOG * fix test * regen sdk * fix changelog * fix readme * fix Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <v-yanzhang@microsoft.com>
-azure_storage_blob-12.3.2:
Describe the bug
I have a customer, she wrote some code wanted to get a MD5 content, it was supposed to return a string, but she got a byte array.
To Reproduce
Steps to reproduce the behavior:
from azure.storage.blob import BlobServiceClient
blob_service_client = BlobServiceClient.from_connection_string(connect_str);
container_client = blob_service_client.get_container_client(container_name)
blob_list = container_client.list_blobs(name_starts_with=src);
for blob in blob_list:
print( blob.name + "\t" + str(blob.content_settings.content_md5) )
Output:
quickstart.txt bytearray(b'\x93\x8f1xZ\xc2]\xc1\xcb\x1f\xd5\x10\xef .\x92')
Expected behavior
Return result should be a string: 'k48xeFrCXcHLH9UQ7yAukg==
Screenshots
N/A
Additional context
Background information from my customer:
from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name=acct_name, account_key=acct_key)
blob_list = block_blob_service.list_blobs(container_name, src, include='metadata')
for blob in blob_list:
print blob.name + "\t" + blob.properties.content_settings.content_md5
The code above works well. But we upgraded our system to python 3 and some featuresare gone, for example, 'blob_tier' is not an attribute of Blobproperties under BlockBlobService.
That is the reason we changed to BlobServiceClient. Then I encountered ‘md5’ issue.
The text was updated successfully, but these errors were encountered: